diff --git a/modules/app/src/main/java/org/locationtech/jtstest/function/BufferFunctions.java b/modules/app/src/main/java/org/locationtech/jtstest/function/BufferFunctions.java index 38781a5eae..e85bdc513c 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/function/BufferFunctions.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/function/BufferFunctions.java @@ -181,6 +181,7 @@ public static Geometry bufferEach(Geometry g, final double distance) { return GeometryMapper.map(g, new MapOp() { + @Override public Geometry map(Geometry g) { return g.buffer(distance); diff --git a/modules/app/src/main/java/org/locationtech/jtstest/function/GeometryFunctions.java b/modules/app/src/main/java/org/locationtech/jtstest/function/GeometryFunctions.java index 6a05383b62..abf4feb4a8 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/function/GeometryFunctions.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/function/GeometryFunctions.java @@ -86,6 +86,7 @@ public static Geometry getPolygonHoles(Geometry geom) final List holePolys = new ArrayList(); geom.apply(new GeometryFilter() { + @Override public void filter(Geometry geom) { if (geom instanceof Polygon) { Polygon poly = (Polygon) geom; diff --git a/modules/app/src/main/java/org/locationtech/jtstest/function/OverlayNGFunctions.java b/modules/app/src/main/java/org/locationtech/jtstest/function/OverlayNGFunctions.java index d65d03d1b5..da41dd92de 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/function/OverlayNGFunctions.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/function/OverlayNGFunctions.java @@ -50,6 +50,7 @@ public static Geometry union(Geometry a, public static Geometry unaryUnion(Geometry a) { UnionStrategy unionSRFun = new UnionStrategy() { + @Override public Geometry union(Geometry g0, Geometry g1) { return OverlayNG.overlay(g0, g1, UNION ); } diff --git a/modules/app/src/main/java/org/locationtech/jtstest/function/OverlayNGRobustFunctions.java b/modules/app/src/main/java/org/locationtech/jtstest/function/OverlayNGRobustFunctions.java index 848cc4c587..8d4a72411c 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/function/OverlayNGRobustFunctions.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/function/OverlayNGRobustFunctions.java @@ -55,6 +55,7 @@ public static Geometry symDifference(Geometry a, Geometry b) { public static Geometry unaryUnion(Geometry a) { UnionStrategy unionSRFun = new UnionStrategy() { + @Override public Geometry union(Geometry g0, Geometry g1) { return overlay(g0, g1, UNION ); } diff --git a/modules/app/src/main/java/org/locationtech/jtstest/function/OverlayNGSnappingFunctions.java b/modules/app/src/main/java/org/locationtech/jtstest/function/OverlayNGSnappingFunctions.java index 133532be74..bc5a5d5645 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/function/OverlayNGSnappingFunctions.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/function/OverlayNGSnappingFunctions.java @@ -47,6 +47,7 @@ private static Noder getNoder(double tolerance) { public static Geometry unaryUnion(Geometry a, double tolerance) { UnionStrategy unionSRFun = new UnionStrategy() { + @Override public Geometry union(Geometry g0, Geometry g1) { return OverlayNGSnappingFunctions.union(g0, g1, tolerance ); } @@ -69,6 +70,7 @@ private static Geometry unionNoValid(Geometry a, Geometry b, double tolerance) { public static Geometry unaryUnionNoValid(Geometry a, double tolerance) { UnionStrategy unionSRFun = new UnionStrategy() { + @Override public Geometry union(Geometry g0, Geometry g1) { return OverlayNGSnappingFunctions.unionNoValid(g0, g1, tolerance ); } diff --git a/modules/app/src/main/java/org/locationtech/jtstest/function/OverlayNoSnapFunctions.java b/modules/app/src/main/java/org/locationtech/jtstest/function/OverlayNoSnapFunctions.java index 93b8c24ebc..ccaf904844 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/function/OverlayNoSnapFunctions.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/function/OverlayNoSnapFunctions.java @@ -26,6 +26,7 @@ public class OverlayNoSnapFunctions { public static Geometry unaryUnion(Geometry a) { UnionStrategy unionSRFun = new UnionStrategy() { + @Override public Geometry union(Geometry g0, Geometry g1) { return OverlayOp.overlayOp(g0, g1, OverlayOp.UNION ); } diff --git a/modules/app/src/main/java/org/locationtech/jtstest/function/PolygonOverlayFunctions.java b/modules/app/src/main/java/org/locationtech/jtstest/function/PolygonOverlayFunctions.java index c62a3ca23e..70265e9f98 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/function/PolygonOverlayFunctions.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/function/PolygonOverlayFunctions.java @@ -39,6 +39,7 @@ public static Geometry overlaySR(Geometry g1, Geometry g2, { PrecisionModel pm = new PrecisionModel(scale); return computeOverlay(g1, g2, new Noder() { + @Override public Geometry node(Geometry inputLines) { return OverlayNG.overlay(inputLines, null, OverlayNG.UNION, pm); } @@ -48,6 +49,7 @@ public Geometry node(Geometry inputLines) { public static Geometry overlay(Geometry g1, Geometry g2) { return computeOverlay(g1, g2, new Noder( ) { + @Override public Geometry node(Geometry inputLines) { return OverlayNGRobust.overlay(inputLines, null, OverlayNG.UNION); } diff --git a/modules/app/src/main/java/org/locationtech/jtstest/function/SelectionFunctions.java b/modules/app/src/main/java/org/locationtech/jtstest/function/SelectionFunctions.java index c58f9aea6e..4ba886db28 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/function/SelectionFunctions.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/function/SelectionFunctions.java @@ -25,6 +25,7 @@ public class SelectionFunctions public static Geometry intersects(Geometry a, final Geometry mask) { return select(a, new GeometryPredicate() { + @Override public boolean isTrue(Geometry g) { return mask.intersects(g); } @@ -34,6 +35,7 @@ public boolean isTrue(Geometry g) { public static Geometry covers(Geometry a, final Geometry mask) { return select(a, new GeometryPredicate() { + @Override public boolean isTrue(Geometry g) { return g.covers(mask); } @@ -43,6 +45,7 @@ public boolean isTrue(Geometry g) { public static Geometry coveredBy(Geometry a, final Geometry mask) { return select(a, new GeometryPredicate() { + @Override public boolean isTrue(Geometry g) { return g.coveredBy(mask); } @@ -85,6 +88,7 @@ public static Geometry invalid(Geometry a) public static Geometry lengthGreaterThan(Geometry a, final double minLen) { return select(a, new GeometryPredicate() { + @Override public boolean isTrue(Geometry g) { return g.getLength() > minLen; } @@ -93,6 +97,7 @@ public boolean isTrue(Geometry g) { public static Geometry lengthLessThan(Geometry a, final double maxLen) { return select(a, new GeometryPredicate() { + @Override public boolean isTrue(Geometry g) { return g.getLength() < maxLen; } @@ -101,6 +106,7 @@ public boolean isTrue(Geometry g) { public static Geometry lengthZero(Geometry a) { return select(a, new GeometryPredicate() { + @Override public boolean isTrue(Geometry g) { return g.getLength() == 0.0; } @@ -109,6 +115,7 @@ public boolean isTrue(Geometry g) { public static Geometry areaGreaterThan(Geometry a, final double minArea) { return select(a, new GeometryPredicate() { + @Override public boolean isTrue(Geometry g) { return g.getArea() > minArea; } @@ -117,6 +124,7 @@ public boolean isTrue(Geometry g) { public static Geometry areaLessThan(Geometry a, final double maxArea) { return select(a, new GeometryPredicate() { + @Override public boolean isTrue(Geometry g) { return g.getArea() < maxArea; } @@ -125,6 +133,7 @@ public boolean isTrue(Geometry g) { public static Geometry areaZero(Geometry a) { return select(a, new GeometryPredicate() { + @Override public boolean isTrue(Geometry g) { return g.getArea() == 0.0; } @@ -133,6 +142,7 @@ public boolean isTrue(Geometry g) { public static Geometry within(Geometry a, final Geometry mask) { return select(a, new GeometryPredicate() { + @Override public boolean isTrue(Geometry g) { return g.within(mask); } @@ -142,6 +152,7 @@ public boolean isTrue(Geometry g) { public static Geometry interiorPointWithin(Geometry a, final Geometry mask) { return select(a, new GeometryPredicate() { + @Override public boolean isTrue(Geometry g) { return g.getInteriorPoint().within(mask); } @@ -151,6 +162,7 @@ public boolean isTrue(Geometry g) { public static Geometry withinDistance(Geometry a, final Geometry mask, double maximumDistance) { return select(a, new GeometryPredicate() { + @Override public boolean isTrue(Geometry g) { return mask.isWithinDistance(g, maximumDistance); } @@ -161,6 +173,7 @@ public static Geometry withinDistanceIndexed(Geometry a, final Geometry mask, do { IndexedFacetDistance indexedDist = new IndexedFacetDistance(mask); return select(a, new GeometryPredicate() { + @Override public boolean isTrue(Geometry g) { boolean isWithinDist = indexedDist.isWithinDistance(g, maximumDistance); return isWithinDist; diff --git a/modules/app/src/main/java/org/locationtech/jtstest/function/SpatialIndexFunctions.java b/modules/app/src/main/java/org/locationtech/jtstest/function/SpatialIndexFunctions.java index db5fb1bd89..099b2433dc 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/function/SpatialIndexFunctions.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/function/SpatialIndexFunctions.java @@ -271,6 +271,7 @@ public static Geometry hprTreeQueryCached(Geometry geoms, Geometry queryEnv) private static void loadIndex(Geometry geom, SpatialIndex index) { geom.apply(new GeometryFilter() { + @Override public void filter(Geometry geom) { // only insert atomic geometries if (geom instanceof GeometryCollection) return; @@ -360,6 +361,7 @@ private static Quadtree buildQuadtree(Geometry geom) { final Quadtree index = new Quadtree(); geom.apply(new GeometryFilter() { + @Override public void filter(Geometry geom) { // only insert atomic geometries if (geom instanceof GeometryCollection) return; diff --git a/modules/app/src/main/java/org/locationtech/jtstest/function/TriangleFunctions.java b/modules/app/src/main/java/org/locationtech/jtstest/function/TriangleFunctions.java index f99b1d74f7..a2aafb0c9a 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/function/TriangleFunctions.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/function/TriangleFunctions.java @@ -26,6 +26,7 @@ public static Geometry centroid(Geometry g) { return GeometryMapper.map(g, new GeometryMapper.MapOp() { + @Override public Geometry map(Geometry g) { Coordinate[] pts = trianglePts(g); Coordinate cc = Triangle.centroid(pts[0], pts[1], pts[2]); @@ -38,6 +39,7 @@ public static Geometry circumcentre(Geometry g) { return GeometryMapper.map(g, new GeometryMapper.MapOp() { + @Override public Geometry map(Geometry g) { Coordinate[] pts = trianglePts(g); Coordinate cc = Triangle.circumcentre(pts[0], pts[1], pts[2]); @@ -65,6 +67,7 @@ public static Geometry circumcentreDD(Geometry g) { return GeometryMapper.map(g, new GeometryMapper.MapOp() { + @Override public Geometry map(Geometry g) { Coordinate[] pts = trianglePts(g); Coordinate cc = Triangle.circumcentreDD(pts[0], pts[1], pts[2]); @@ -92,6 +95,7 @@ public static Geometry incentre(Geometry g) { return GeometryMapper.map(g, new GeometryMapper.MapOp() { + @Override public Geometry map(Geometry g) { Coordinate[] pts = trianglePts(g); Coordinate cc = Triangle.inCentre(pts[0], pts[1], pts[2]); diff --git a/modules/app/src/main/java/org/locationtech/jtstest/geomfunction/BaseGeometryFunction.java b/modules/app/src/main/java/org/locationtech/jtstest/geomfunction/BaseGeometryFunction.java index 649284cb9c..58ec77ddff 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/geomfunction/BaseGeometryFunction.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/geomfunction/BaseGeometryFunction.java @@ -83,21 +83,25 @@ public BaseGeometryFunction( this.returnType = returnType; } + @Override public String getCategory() { return category; } + @Override public String getName() { return name; } + @Override public String getDescription() { return description; } + @Override public String[] getParameterNames() { return parameterNames; @@ -109,24 +113,29 @@ public String[] getParameterNames() * * @return the types */ + @Override public Class[] getParameterTypes() { return parameterTypes; } + @Override public Class getReturnType() { return returnType; } + @Override public boolean isBinary() { return parameterTypes.length > 0 && parameterTypes[0] == Geometry.class; } + @Override public boolean isRequiredB() { return isRequiredB; } + @Override public String getSignature() { StringBuffer paramTypes = new StringBuffer(); @@ -154,6 +163,7 @@ protected static Integer getIntegerOrNull(Object[] args, int index) return (Integer) args[index]; } + @Override public abstract Object invoke(Geometry geom, Object[] args); /** @@ -193,6 +203,7 @@ public int hashCode() { return result; } + @Override public int compareTo(Object o) { GeometryFunction func = (GeometryFunction) o; diff --git a/modules/app/src/main/java/org/locationtech/jtstest/geomfunction/FilterGeometryFunction.java b/modules/app/src/main/java/org/locationtech/jtstest/geomfunction/FilterGeometryFunction.java index 1b96181a76..d004b860e2 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/geomfunction/FilterGeometryFunction.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/geomfunction/FilterGeometryFunction.java @@ -38,38 +38,47 @@ public FilterGeometryFunction(GeometryFunction fun, int op, double val) { this.filterVal = val; } + @Override public String getCategory() { return fun.getCategory(); } + @Override public String getName() { return fun.getName() + "?"; } + @Override public String getDescription() { return fun.getDescription(); } + @Override public String[] getParameterNames() { return fun.getParameterNames(); } + @Override public Class[] getParameterTypes() { return fun.getParameterTypes(); } + @Override public Class getReturnType() { return Geometry.class; } + @Override public String getSignature() { return fun.getSignature(); } + @Override public boolean isBinary() { return fun.isBinary(); } + @Override public boolean isRequiredB() { return fun.isRequiredB(); } diff --git a/modules/app/src/main/java/org/locationtech/jtstest/geomfunction/RepeaterGeometryFunction.java b/modules/app/src/main/java/org/locationtech/jtstest/geomfunction/RepeaterGeometryFunction.java index 7bd48e9428..a0ac779bda 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/geomfunction/RepeaterGeometryFunction.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/geomfunction/RepeaterGeometryFunction.java @@ -40,30 +40,37 @@ public RepeaterGeometryFunction(GeometryFunction fun, int count) { hasRepeatableArg = hasRepeatableArg(fun); } + @Override public String getCategory() { return fun.getCategory(); } + @Override public String getName() { return fun.getName() + repeatAnnotation(); } + @Override public String getDescription() { return fun.getDescription(); } + @Override public String[] getParameterNames() { return fun.getParameterNames(); } + @Override public Class[] getParameterTypes() { return fun.getParameterTypes(); } + @Override public Class getReturnType() { return fun.getReturnType(); } + @Override public String getSignature() { return fun.getSignature(); } @@ -72,14 +79,17 @@ private String repeatAnnotation() { return "*" + count; } + @Override public boolean isBinary() { return fun.isBinary(); } + @Override public boolean isRequiredB() { return fun.isRequiredB(); } + @Override public Object invoke(Geometry geom, Object[] args) { if (! isRepeatable(fun)) { diff --git a/modules/app/src/main/java/org/locationtech/jtstest/geomfunction/SpreaderGeometryFunction.java b/modules/app/src/main/java/org/locationtech/jtstest/geomfunction/SpreaderGeometryFunction.java index 8a272bef4e..028b22143b 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/geomfunction/SpreaderGeometryFunction.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/geomfunction/SpreaderGeometryFunction.java @@ -29,10 +29,12 @@ public SpreaderGeometryFunction(GeometryFunction fun, boolean eachA, boolean eac this.isEachB = eachB; } + @Override public String getCategory() { return fun.getCategory(); } + @Override public String getName() { String name = fun.getName(); if (isEachA) name += "*A"; @@ -40,32 +42,40 @@ public String getName() { return name; } + @Override public String getDescription() { return fun.getDescription(); } + @Override public String[] getParameterNames() { return fun.getParameterNames(); } + @Override public Class[] getParameterTypes() { return fun.getParameterTypes(); } + @Override public Class getReturnType() { return fun.getReturnType(); } + @Override public String getSignature() { return fun.getSignature(); } + @Override public boolean isBinary() { return fun.isBinary(); } + @Override public boolean isRequiredB() { return fun.isRequiredB(); } + @Override public Object invoke(Geometry geom, Object[] args) { List result = new ArrayList(); if (isEachA) { diff --git a/modules/app/src/main/java/org/locationtech/jtstest/geomfunction/StaticMethodGeometryFunction.java b/modules/app/src/main/java/org/locationtech/jtstest/geomfunction/StaticMethodGeometryFunction.java index dba8b46203..01c449f7f5 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/geomfunction/StaticMethodGeometryFunction.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/geomfunction/StaticMethodGeometryFunction.java @@ -158,7 +158,8 @@ public StaticMethodGeometryFunction( isRequiredB = extractRequiredB(method); } - public Object invoke(Geometry g, Object[] arg) + @Override + public Object invoke(Geometry g, Object[] arg) { return invoke(method, null, createFullArgs(g, arg)); } diff --git a/modules/app/src/main/java/org/locationtech/jtstest/test/TestCase.java b/modules/app/src/main/java/org/locationtech/jtstest/test/TestCase.java index bd0a67503a..233374c44c 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/test/TestCase.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/test/TestCase.java @@ -87,6 +87,7 @@ public TestCase(TestCase tc) { tc.getExpectedBoundary()); } + @Override public void setGeometry(int index, Geometry g) { geom[index] = g; } @@ -96,6 +97,7 @@ public TestCase setPrecisionModel(PrecisionModel pm) this.pm = pm; return this; } + @Override public void setIntersectionMatrix(IntersectionMatrix im) { this.im = im; } @@ -114,6 +116,7 @@ public TestCase setTestName(String name) { return this; } + @Override public void setName(String name) { this.name = name; } @@ -176,10 +179,12 @@ public TestCase setB(String wktb) { return this; } + @Override public Geometry getGeometry(int index) { return geom[index]; } + @Override public IntersectionMatrix getIntersectionMatrix() { return im; } @@ -188,10 +193,12 @@ public String getExpectedIntersectionMatrix() { return expectedIM; } + @Override public String getName() { return name; } + @Override public String getDescription() { return description; } @@ -212,6 +219,7 @@ public boolean isRun() { return isRun; } + @Override public String getWellKnownText(int i) { if (geom[i] == null) { return null; @@ -293,6 +301,7 @@ public void runTest() throws ParseException { } } + @Override public void initGeometry() throws ParseException { GeometryFactory fact = new GeometryFactory(pm, 0); WKTReader wktRdr = new WKTReader(fact); diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/BusyDialog.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/BusyDialog.java index df061770a7..0c3d235cca 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/BusyDialog.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/BusyDialog.java @@ -58,6 +58,7 @@ public interface Executable { private String stackTrace = null; private javax.swing.Timer timer = new javax.swing.Timer(250, new ActionListener() { + @Override public void actionPerformed(ActionEvent evt) { label.setText(description); if (!thread.isAlive()) { @@ -94,6 +95,7 @@ private void jbInit() throws Exception { this.getContentPane().setLayout(gridBagLayout1); this.addWindowListener(new java.awt.event.WindowAdapter() { + @Override public void windowOpened(WindowEvent e) { this_windowOpened(e); } @@ -136,6 +138,7 @@ void this_windowOpened(WindowEvent e) { label.setText(description); Runnable runnable = new Runnable() { + @Override public void run() { try { executable.execute(); diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/CommandPanel.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/CommandPanel.java index 3c107cd349..9a6d0b643f 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/CommandPanel.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/CommandPanel.java @@ -78,12 +78,15 @@ void jbInit() throws Exception { //txtResult.setBackground(AppColors.BACKGROUND); // save command whenever it is changed txtCmd.getDocument().addDocumentListener(new DocumentListener() { + @Override public void changedUpdate(DocumentEvent e) { save(); } + @Override public void removeUpdate(DocumentEvent e) { //save(); } + @Override public void insertUpdate(DocumentEvent e) { save(); } @@ -124,12 +127,14 @@ public void save() { JButton btnRun = SwingUtil.createButton(AppIcons.EXECUTE, "Run Command", new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { doRun(); } }); JButton btnPaste = SwingUtil.createButton(AppIcons.PASTE, "Paste Command", new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { setCommandText(getPaste()); update(); @@ -137,6 +142,7 @@ public void actionPerformed(ActionEvent e) { }); JButton btnClear = SwingUtil.createButton(AppIcons.CUT, "Clear Command", new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { setCommandText(""); update(); @@ -144,6 +150,7 @@ public void actionPerformed(ActionEvent e) { }); JButton btnPrev = SwingUtil.createButton(AppIcons.LEFT, "Previous Command", new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { if (historyIndex == -1) { historyIndex = commandLog.size()-1; @@ -157,6 +164,7 @@ else if (historyIndex > 0) { }); JButton btnNext = SwingUtil.createButton(AppIcons.RIGHT, "Next Command", new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { if (historyIndex == -1) return; if (historyIndex == commandLog.size()-1) { @@ -189,6 +197,7 @@ public void actionPerformed(ActionEvent e) { JButton btnAwkt = SwingUtil.createButton("A-WKT", "Insert variable " + CommandController.VAR_A + " for A as WKT", new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { insertCmdText(CommandController.VAR_A); } @@ -196,6 +205,7 @@ public void actionPerformed(ActionEvent e) { JButton btnAwkb = SwingUtil.createButton("A-WKB", "Insert variable " + CommandController.VAR_A_WKB + " for A as WKB", new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { insertCmdText(CommandController.VAR_A_WKB); } @@ -203,6 +213,7 @@ public void actionPerformed(ActionEvent e) { JButton btnBwkt = SwingUtil.createButton("B-WKT", "Insert variable " + CommandController.VAR_B + " for B as WKT", new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { insertCmdText(CommandController.VAR_B); } @@ -210,6 +221,7 @@ public void actionPerformed(ActionEvent e) { JButton btnBwkb = SwingUtil.createButton("B-WKB", "Insert variable " + CommandController.VAR_B_WKB + " for B as WKB", new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { insertCmdText(CommandController.VAR_B_WKB); } diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/GeometryEditPanel.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/GeometryEditPanel.java index 3ca39506c5..d5704ba251 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/GeometryEditPanel.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/GeometryEditPanel.java @@ -115,6 +115,7 @@ public GeometryEditPanel() { void initUI() throws Exception { this.addComponentListener(new java.awt.event.ComponentAdapter() { + @Override public void componentResized(ComponentEvent e) { this_componentResized(e); } @@ -132,11 +133,13 @@ public void componentResized(ComponentEvent e) { class PopupClickListener extends MouseAdapter { + @Override public void mousePressed(MouseEvent e) { if (e.isPopupTrigger()) doPopUp(e); } + @Override public void mouseReleased(MouseEvent e) { if (e.isPopupTrigger()) @@ -242,6 +245,7 @@ public void updateGeom() getGeomModel().geomChanged(); } + @Override public String getToolTipText(MouseEvent event) { // if (event.getPoint().x < 100) return null; Coordinate pt = viewport.toModelCoordinate(event.getPoint()); @@ -266,6 +270,7 @@ public String getInfo(Coordinate pt) return writer.writeLocationString(getLayerList(), pt, toleranceInModel); } + @Override public void paintComponent(Graphics g) { super.paintComponent(g); renderMgr.render(); @@ -596,6 +601,7 @@ public GeometryEditPanelRenderer() } } + @Override public void render(Graphics2D g2) { g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, @@ -795,6 +801,7 @@ public void renderRevealTopoWarning(Graphics2D g) } + @Override public synchronized void cancel() { if (currentRenderer != null) diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/GeometryFunctionListPanel.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/GeometryFunctionListPanel.java index c2ae2e79f0..0fd7266c33 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/GeometryFunctionListPanel.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/GeometryFunctionListPanel.java @@ -44,6 +44,7 @@ public class GeometryFunctionListPanel extends JPanel { JScrollPane jScrollPane1 = new JScrollPane(); JList list = new JList(listModel){ + @Override public String getToolTipText(MouseEvent e) { int index = locationToIndex(e.getPoint()); if (-1 < index) { @@ -69,6 +70,7 @@ private class GeometryFunctionCellRenderer extends JLabel implements private final ImageIcon unaryIcon = new ImageIcon(this.getClass() .getResource("UnaryGeomFunction.png")); + @Override public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { GeometryFunction func = (GeometryFunction) value; diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/GeometryFunctionTreePanel.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/GeometryFunctionTreePanel.java index 3f6f0cb7eb..58847a79c8 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/GeometryFunctionTreePanel.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/GeometryFunctionTreePanel.java @@ -75,6 +75,7 @@ private class GeometryFunctionRenderer extends DefaultTreeCellRenderer { public GeometryFunctionRenderer() { } + @Override public Component getTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus) { @@ -127,6 +128,7 @@ private void jbInit() throws Exception { TreeSelectionModel.SINGLE_TREE_SELECTION); tree.addMouseListener(new MouseAdapter() { + @Override public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 2) { GeometryFunction fun = getFunction(); @@ -137,6 +139,7 @@ public void mouseClicked(MouseEvent e) { } }); tree.addTreeSelectionListener(new TreeSelectionListener() { + @Override public void valueChanged(TreeSelectionEvent e) { GeometryFunction fun = getFunction(); if (fun != null) diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/GeometryInputDialog.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/GeometryInputDialog.java index 2b4d5b8048..1457f9feb6 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/GeometryInputDialog.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/GeometryInputDialog.java @@ -88,6 +88,7 @@ void jbInit() throws Exception { btnLoad.setText("Load"); btnLoad.addActionListener(new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { btnLoad_actionPerformed(e); } @@ -95,6 +96,7 @@ public void actionPerformed(ActionEvent e) { btnCancel.setText("Cancel"); btnCancel.addActionListener(new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { btnCancel_actionPerformed(e); } diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/GeometryPopupMenu.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/GeometryPopupMenu.java index 5c40f512fb..8ba1f20fb6 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/GeometryPopupMenu.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/GeometryPopupMenu.java @@ -34,6 +34,7 @@ private void initUI() JMenuItem extractComponentItem = new JMenuItem("Extract Component"); extractComponentItem.addActionListener( new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { JTSTestBuilder.controller().extractComponentsToTestCase(clickCoord); } @@ -43,6 +44,7 @@ public void actionPerformed(ActionEvent e) { JMenuItem copyComponentItem = new JMenuItem("Copy Component"); copyComponentItem.addActionListener( new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { JTSTestBuilder.controller().copyComponentToClipboard(clickCoord); } @@ -52,6 +54,7 @@ public void actionPerformed(ActionEvent e) { JMenuItem infoItem = new JMenuItem("Info"); infoItem.addActionListener( new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { JTSTestBuilder.controller().displayInfo(clickCoord); } @@ -63,6 +66,7 @@ public void actionPerformed(ActionEvent e) { /** * Record model coordinate of click point for use in menu operations */ + @Override public void show(Component invoker, int x, int y) { GeometryEditPanel editPanel = (GeometryEditPanel) invoker; diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/GeometryTreeModel.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/GeometryTreeModel.java index cfcb246a1e..b98f5c8157 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/GeometryTreeModel.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/GeometryTreeModel.java @@ -56,6 +56,7 @@ public GeometryTreeModel(Geometry geom, int source, Comparator comp) /** * Adds a listener for the TreeModelEvent posted after the tree changes. */ + @Override public void addTreeModelListener(TreeModelListener l) { treeModelListeners.addElement(l); @@ -64,6 +65,7 @@ public void addTreeModelListener(TreeModelListener l) /** * Returns the child of parent at index index in the parent's child array. */ + @Override public Object getChild(Object parent, int index) { GeometricObjectNode gn = (GeometricObjectNode) parent; @@ -73,6 +75,7 @@ public Object getChild(Object parent, int index) /** * Returns the number of children of parent. */ + @Override public int getChildCount(Object parent) { GeometricObjectNode gn = (GeometricObjectNode) parent; @@ -82,6 +85,7 @@ public int getChildCount(Object parent) /** * Returns the index of child in parent. */ + @Override public int getIndexOfChild(Object parent, Object child) { GeometricObjectNode gn = (GeometricObjectNode) parent; @@ -91,6 +95,7 @@ public int getIndexOfChild(Object parent, Object child) /** * Returns the root of the tree. */ + @Override public Object getRoot() { return rootGeom; @@ -99,6 +104,7 @@ public Object getRoot() /** * Returns true if node is a leaf. */ + @Override public boolean isLeaf(Object node) { GeometricObjectNode gn = (GeometricObjectNode) node; @@ -108,6 +114,7 @@ public boolean isLeaf(Object node) /** * Removes a listener previously added with addTreeModelListener(). */ + @Override public void removeTreeModelListener(TreeModelListener l) { treeModelListeners.removeElement(l); @@ -117,6 +124,7 @@ public void removeTreeModelListener(TreeModelListener l) * Messaged when the user has altered the value for the item identified by * path to newValue. Not used by this model. */ + @Override public void valueForPathChanged(TreePath path, Object newValue) { System.out @@ -284,16 +292,19 @@ private static String geometryText(Geometry geom, int size, String tag) return buf.toString(); } + @Override public boolean isLeaf() { return isLeaf; } + @Override public ImageIcon getIcon() { return context.source == 0 ? AppIcons.ICON_POLYGON : AppIcons.ICON_POLYGON_B; } + @Override public GeometricObjectNode getChildAt(int index) { if (isLeaf) @@ -302,6 +313,7 @@ public GeometricObjectNode getChildAt(int index) return children.get(index); } + @Override public int getChildCount() { if (isLeaf) @@ -310,6 +322,7 @@ public int getChildCount() return children.size(); } + @Override public int getIndexOfChild(GeometricObjectNode child) { if (isLeaf) @@ -345,16 +358,19 @@ class PolygonNode extends GeometryNode this.poly = poly; } + @Override public Geometry getGeometry() { return poly; } + @Override public ImageIcon getIcon() { return context.source == 0 ? AppIcons.ICON_POLYGON : AppIcons.ICON_POLYGON_B; } + @Override protected void fillChildren() { for (int i = 0; i < poly.getNumInteriorRing(); i++) { @@ -386,16 +402,19 @@ public LineStringNode(LineString line, String tag, GeometryContext context) this.line = line; } + @Override public ImageIcon getIcon() { return context.source == 0 ? AppIcons.ICON_LINESTRING : AppIcons.ICON_LINESTRING_B; } + @Override public Geometry getGeometry() { return line; } + @Override protected void fillChildren() { populateChildren(line.getCoordinates()); @@ -425,6 +444,7 @@ public LinearRingNode(LinearRing ring, String tag, GeometryContext context) { super(ring, tag, context); } + @Override public ImageIcon getIcon() { return context.source == 0 ? AppIcons.ICON_LINEARRING : AppIcons.ICON_LINEARRING_B; @@ -441,16 +461,19 @@ public PointNode(Point p, GeometryContext context) pt = p; } + @Override public ImageIcon getIcon() { return context.source == 0 ? AppIcons.ICON_POINT : AppIcons.ICON_POINT_B; } + @Override public Geometry getGeometry() { return pt; } + @Override protected void fillChildren() { children.add(CoordinateNode.create(pt.getCoordinate())); @@ -467,11 +490,13 @@ class GeometryCollectionNode extends GeometryNode this.coll = coll; } + @Override public Geometry getGeometry() { return coll; } + @Override protected void fillChildren() { for (int i = 0; i < coll.getNumGeometries(); i++) { @@ -484,6 +509,7 @@ protected void fillChildren() } } + @Override public ImageIcon getIcon() { return context.source == 0 ? AppIcons.ICON_COLLECTION : AppIcons.ICON_COLLECTION_B; @@ -536,11 +562,13 @@ public CoordinateNode(Coordinate coord, int i, double distPrev) this.coord = coord; this.index = i; } + @Override public ImageIcon getIcon() { return AppIcons.ICON_POINT; } + @Override public Geometry getGeometry() { GeometryFactory geomFact = new GeometryFactory(); diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/GeometryTreePanel.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/GeometryTreePanel.java index 6d8ab5ae75..3218f22a3a 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/GeometryTreePanel.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/GeometryTreePanel.java @@ -49,6 +49,7 @@ private class GeometryTreeCellRenderer extends DefaultTreeCellRenderer { public GeometryTreeCellRenderer() { } + @Override public Component getTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus) { @@ -94,6 +95,7 @@ private void initUI() throws Exception { tree.addMouseListener(new MouseAdapter() { + @Override public void mouseClicked(MouseEvent e) { Geometry geom = getSelectedGeometry(); if (geom == null) return; @@ -108,6 +110,7 @@ public void mouseClicked(MouseEvent e) { } }); tree.addTreeSelectionListener(new TreeSelectionListener() { + @Override public void valueChanged(TreeSelectionEvent e) { //GeometryFunction fun = getFunction(); //if (fun != null) @@ -168,13 +171,15 @@ public void populate(Geometry geom, int source, Comparator comp) { } //Required by TreeWillExpandListener interface. - public void treeWillExpand(TreeExpansionEvent e) + @Override + public void treeWillExpand(TreeExpansionEvent e) throws ExpandVetoException { TreePath path = e.getPath(); Object lastComp = path.getLastPathComponent(); } //Required by TreeWillExpandListener interface. + @Override public void treeWillCollapse(TreeExpansionEvent e) { // take no action } diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/GeometryViewStylePanel.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/GeometryViewStylePanel.java index 8946d5af76..3115a67793 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/GeometryViewStylePanel.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/GeometryViewStylePanel.java @@ -58,6 +58,7 @@ private void uiInit() { cbTitle.setSelected(viewStyle.isTitleEnabled()); cbTitle.setAlignmentX(Component.LEFT_ALIGNMENT); cbTitle.addActionListener(new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { updateView(); } }); @@ -65,6 +66,7 @@ public void actionPerformed(ActionEvent e) { cbTitleBorder.setSelected(viewStyle.isTitleBorderEnabled()); cbTitleBorder.setAlignmentX(Component.LEFT_ALIGNMENT); cbTitleBorder.addActionListener(new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { updateView(); } }); @@ -72,6 +74,7 @@ public void actionPerformed(ActionEvent e) { "Title fill color", viewStyle.getTitleFill(), new ColorControl.ColorListener() { + @Override public void colorChanged(Color clr) { updateView(); } @@ -84,6 +87,7 @@ public void colorChanged(Color clr) { cbLegend.setSelected(viewStyle.isLegendEnabled()); cbLegend.setAlignmentX(Component.LEFT_ALIGNMENT); cbLegend.addActionListener(new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { updateView(); } }); @@ -91,6 +95,7 @@ public void actionPerformed(ActionEvent e) { cbLegendBorder.setSelected(viewStyle.isLegendBorderEnabled()); cbLegendBorder.setAlignmentX(Component.LEFT_ALIGNMENT); cbLegendBorder.addActionListener(new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { updateView(); } }); @@ -98,6 +103,7 @@ public void actionPerformed(ActionEvent e) { "Legend fill color", viewStyle.getLegendFill(), new ColorControl.ColorListener() { + @Override public void colorChanged(Color clr) { updateView(); } @@ -107,6 +113,7 @@ public void colorChanged(Color clr) { cbLegendStats.setSelected(viewStyle.isLegendStatsEnabled()); cbLegendStats.setAlignmentX(Component.LEFT_ALIGNMENT); cbLegendStats.addActionListener(new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { updateView(); } }); @@ -114,6 +121,7 @@ public void actionPerformed(ActionEvent e) { cbLegendMetrics.setSelected(viewStyle.isLegendStatsEnabled()); cbLegendMetrics.setAlignmentX(Component.LEFT_ALIGNMENT); cbLegendMetrics.addActionListener(new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { updateView(); } }); @@ -124,6 +132,7 @@ public void actionPerformed(ActionEvent e) { cbViewBorder.setSelected(viewStyle.isBorderEnabled()); cbViewBorder.setAlignmentX(Component.LEFT_ALIGNMENT); cbViewBorder.addActionListener(new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { updateView(); } }); @@ -131,6 +140,7 @@ public void actionPerformed(ActionEvent e) { "Border Color", viewStyle.getBorderColor(), new ColorControl.ColorListener() { + @Override public void colorChanged(Color clr) { updateView(); } @@ -143,6 +153,7 @@ public void colorChanged(Color clr) { cbGrid.setSelected(viewStyle.isGridEnabled()); cbGrid.setAlignmentX(Component.LEFT_ALIGNMENT); cbGrid.addActionListener(new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { updateView(); } }); @@ -151,6 +162,7 @@ public void actionPerformed(ActionEvent e) { "Background Color", viewStyle.getBackground(), new ColorControl.ColorListener() { + @Override public void colorChanged(Color clr) { updateView(); } diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/InspectorPanel.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/InspectorPanel.java index 62fd8f2162..69534beb3d 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/InspectorPanel.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/InspectorPanel.java @@ -60,6 +60,7 @@ public InspectorPanel(boolean showExpand) { uiInit(); } + @Override protected void uiInit() { this.setLayout(new BorderLayout()); geomTreePanel = new GeometryTreePanel(); @@ -68,26 +69,31 @@ protected void uiInit() { this.add(geomTreePanel, BorderLayout.CENTER); JButton btnZoom = SwingUtil.createButton(AppIcons.ZOOM, "Zoom to component", new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { actionZoom(e); } }); JButton btnCopy = SwingUtil.createButton(AppIcons.COPY, "Copy (Ctl-click to Copy formatted", new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { actionCopy(e); } }); JButton btnNext = SwingUtil.createButton(AppIcons.DOWN, "Next (Ctl-click to Zoom)", new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { actionZoomNext(e, 1); } }); JButton btnPrev = SwingUtil.createButton(AppIcons.UP, "Previous (Ctl-click to Zoom)", new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { actionZoomNext(e, -1); } }); btnDelete = SwingUtil.createButton(AppIcons.DELETE, "Delete", new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { deleteGeom(); } @@ -114,16 +120,19 @@ public void actionPerformed(ActionEvent e) { this.add(btnPanel, BorderLayout.WEST); JButton btnSortNone = SwingUtil.createButton(AppIcons.CLEAR, "Unsorted", new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { sortNone(); } }); JButton btnSortByArea = SwingUtil.createButton(AppIcons.ICON_POLYGON, "Sort by Area (Asc/Desc)", new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { sortByArea(); } }); JButton btnSortByLen = SwingUtil.createButton(AppIcons.ICON_LINESTRING, "Sort by Length (Asc/Desc)", new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { sortByLen(); } @@ -136,6 +145,7 @@ public void actionPerformed(ActionEvent e) { btnExpand.setText("..."); btnExpand.setToolTipText("Display in window"); btnExpand.addActionListener(new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { btnExpand_actionPerformed(); diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/JTSTestBuilder.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/JTSTestBuilder.java index 774730cdd2..877450189e 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/JTSTestBuilder.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/JTSTestBuilder.java @@ -150,6 +150,7 @@ private static void setLookAndFeel() throws InterruptedException, InvocationTarg * Invoke on Swing thread to pass Java security requirements */ javax.swing.SwingUtilities.invokeAndWait(new Runnable() { + @Override public void run() { try { diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/JTSTestBuilderFrame.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/JTSTestBuilderFrame.java index 7e4a44e9c3..8be8f9b925 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/JTSTestBuilderFrame.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/JTSTestBuilderFrame.java @@ -105,6 +105,7 @@ public JTSTestBuilderFrame() { jbInit(); testCasePanel.cbRevealTopo.addActionListener( new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { displayRevealTopo(); } @@ -112,6 +113,7 @@ public void actionPerformed(ActionEvent e) { //testCasePanel.editCtlPanel.stretchDist testCasePanel.spStretchDist .addChangeListener(new javax.swing.event.ChangeListener() { + @Override public void stateChanged(javax.swing.event.ChangeEvent e) { displayRevealTopo(); } @@ -128,6 +130,7 @@ public void stateChanged(javax.swing.event.ChangeEvent e) { private void initFileDrop(Component comp) { new FileDrop(comp, new FileDrop.Listener() { + @Override public void filesDropped(java.io.File[] files) { try { openXmlFilesAndDirectories(files); @@ -196,6 +199,7 @@ public void setModel(TestBuilderModel model) model.getGeometryEditModel().addGeometryListener( new org.locationtech.jtstest.testbuilder.model.GeometryListener() { + @Override public void geometryChanged(GeometryEvent e) { model_geometryChanged(e); } @@ -292,6 +296,7 @@ public void openXmlFilesAndDirectories(File[] files) throws Exception { /** * Overridden so we can exit when window is closed */ + @Override protected void processWindowEvent(WindowEvent e) { super.processWindowEvent(e); if (e.getID() == WindowEvent.WINDOW_CLOSING) { @@ -450,6 +455,7 @@ private void jbInit() throws Exception { inputTabbedPane.add(commandPanel, AppStrings.TAB_LABEL_COMMAND); inputTabbedPane.setSelectedIndex(1); inputTabbedPane.addChangeListener(new ChangeListener() { + @Override public void stateChanged(ChangeEvent e) { updateStatsPanelIfVisible(); diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/JTSTestBuilderMenuBar.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/JTSTestBuilderMenuBar.java index a59ecf46c9..98159af0b8 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/JTSTestBuilderMenuBar.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/JTSTestBuilderMenuBar.java @@ -56,6 +56,7 @@ public JMenuBar getMenuBar() jMenuAbout.setText("About"); jMenuAbout.addActionListener( new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { TestBuilderDialogs.showAbout(tbFrame); } @@ -64,6 +65,7 @@ public void actionPerformed(ActionEvent e) { jMenuFileExit.setText("Exit"); jMenuFileExit.addActionListener( new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { tbFrame.actionExit(); } @@ -71,6 +73,7 @@ public void actionPerformed(ActionEvent e) { menuViewText.setText("Test Case Text..."); menuViewText.addActionListener( new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { TestBuilderDialogs.viewCaseText(tbFrame); } @@ -78,6 +81,7 @@ public void actionPerformed(ActionEvent e) { menuViewGeometry.setText("Geometry Inspector..."); menuViewGeometry.addActionListener( new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { JTSTestBuilder.controller().inspectGeometryDialogForCurrentCase(); } @@ -85,6 +89,7 @@ public void actionPerformed(ActionEvent e) { JMenuItem menuShowIndicators = menuItemCheck("Show Indicators", JTSTestBuilderFrame.isShowingIndicators, new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { JTSTestBuilderFrame.isShowingIndicators = ! JTSTestBuilderFrame.isShowingIndicators; } @@ -92,6 +97,7 @@ public void actionPerformed(ActionEvent e) { JMenuItem menuSaveIndicators = menuItemCheck("Save Indicators", JTSTestBuilderFrame.isSavingIndicators, new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { JTSTestBuilderFrame.isSavingIndicators = ! JTSTestBuilderFrame.isSavingIndicators; } @@ -99,6 +105,7 @@ public void actionPerformed(ActionEvent e) { menuLoadXmlTestFile.setText("Open XML File(s)..."); menuLoadXmlTestFile.addActionListener( new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { tbFrame.menuLoadXmlTestFile_actionPerformed(e); } @@ -106,6 +113,7 @@ public void actionPerformed(ActionEvent e) { saveAsXmlMenuItem.setText("Save As XML..."); saveAsXmlMenuItem.addActionListener( new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { TestBuilderDialogs.saveAsXML(tbFrame, JTSTestBuilder.model()); } @@ -113,6 +121,7 @@ public void actionPerformed(ActionEvent e) { saveAsHtmlMenuItem.setText("Save As HTML..."); saveAsHtmlMenuItem.addActionListener( new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { TestBuilderDialogs.saveAsHtml(tbFrame, JTSTestBuilder.model()); } @@ -121,6 +130,7 @@ public void actionPerformed(ActionEvent e) { saveAsSvgMenuItem.setText("Save As HTML+SVG..."); saveAsSvgMenuItem.addActionListener( new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { TestBuilderDialogs.saveAsHtmlSVG(tbFrame, JTSTestBuilder.model()); } @@ -128,6 +138,7 @@ public void actionPerformed(ActionEvent e) { saveAsPNGMenuItem.setText("Save As PNG..."); saveAsPNGMenuItem.addActionListener( new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { JTSTestBuilder.controller().saveImageAsPNG(); } @@ -135,6 +146,7 @@ public void actionPerformed(ActionEvent e) { saveToClipboardMenuItem.setText("Save Screen To Clipboard"); saveToClipboardMenuItem.addActionListener( new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { JTSTestBuilder.controller().saveImageToClipboard(); } @@ -142,6 +154,7 @@ public void actionPerformed(ActionEvent e) { deleteAllTestCasesMenuItem.setText("Delete All Test Cases"); deleteAllTestCasesMenuItem.addActionListener( new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { tbFrame.actionDeleteAllTestCases(); } @@ -150,6 +163,7 @@ public void actionPerformed(ActionEvent e) { menuLoadXmlTestFolder.setText("Open XML Folder(s)..."); menuLoadXmlTestFolder.addActionListener( new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { tbFrame.actionLoadXmlTestFolder(); } @@ -157,18 +171,21 @@ public void actionPerformed(ActionEvent e) { precisionModelMenuItem.setText("Precision Model..."); precisionModelMenuItem.addActionListener( new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { TestBuilderDialogs.precisionModel(tbFrame); } }); removeDuplicatePoints.setText("Remove Duplicate Points"); removeDuplicatePoints.addActionListener(new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { JTSTestBuilder.controller().removeDuplicatePoints(); } }); changeToLines.setText("Change to Lines"); changeToLines.addActionListener(new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { JTSTestBuilder.controller().changeToLines(); } diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/JTSTestBuilderToolBar.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/JTSTestBuilderToolBar.java index 3a644a842b..d7906472c8 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/JTSTestBuilderToolBar.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/JTSTestBuilderToolBar.java @@ -104,6 +104,7 @@ public JToolBar getToolBar() JButton previousButton = createButton( AppStrings.TIP_PREV, leftIcon, new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { boolean isZoom = 0 == (e.getModifiers() & ActionEvent.CTRL_MASK); controller().caseMoveTo(-1, isZoom); @@ -112,6 +113,7 @@ public void actionPerformed(ActionEvent e) { JButton nextButton = createButton( AppStrings.TIP_NEXT, rightIcon, new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { boolean isZoom = 0 == (e.getModifiers() & ActionEvent.CTRL_MASK); controller().caseMoveTo(1, isZoom); @@ -120,6 +122,7 @@ public void actionPerformed(ActionEvent e) { JButton newButton = createButton( AppStrings.TIP_CASE_ADD_NEW, plusIcon, new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { controller().caseCreateNew(); } @@ -127,6 +130,7 @@ public void actionPerformed(ActionEvent e) { JButton copyButton = createButton( AppStrings.TIP_CASE_DUP, copyCaseIcon, new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { controller().caseCopy(); } @@ -134,6 +138,7 @@ public void actionPerformed(ActionEvent e) { JButton deleteButton = createButton( AppStrings.TIP_CASE_DELETE, deleteIcon, new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { controller().caseDelete(); } @@ -141,6 +146,7 @@ public void actionPerformed(ActionEvent e) { JButton oneToOneButton = createButton( AppStrings.TIP_ZOOM_1_1, zoomOneToOneIcon, new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { controller().zoomOneToOne(); } @@ -148,6 +154,7 @@ public void actionPerformed(ActionEvent e) { JButton zoomToInputButton = createButton( "Zoom To Input", zoomToInputIcon, new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { controller().zoomToInput(); } @@ -155,6 +162,7 @@ public void actionPerformed(ActionEvent e) { JButton zoomToInputAButton = createButton( AppStrings.TIP_ZOOM_TO_A, zoomToInputAIcon, new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { controller().zoomToInputA(); } @@ -162,6 +170,7 @@ public void actionPerformed(ActionEvent e) { JButton zoomToInputBButton = createButton( AppStrings.TIP_ZOOM_TO_B, zoomToInputBIcon, new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { controller().zoomToInputB(); } @@ -169,6 +178,7 @@ public void actionPerformed(ActionEvent e) { JButton zoomToResultButton = createButton( AppStrings.TIP_ZOOM_TO_RESULT, zoomToResultIcon, new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { controller().zoomToResult(); } @@ -176,6 +186,7 @@ public void actionPerformed(ActionEvent e) { JButton zoomToFullExtentButton = createButton( AppStrings.TIP_ZOOM_TO_FULL_EXTENT, zoomToFullExtentIcon, new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { controller().zoomToFullExtent(); } @@ -184,6 +195,7 @@ public void actionPerformed(ActionEvent e) { drawRectangleButton = createToggleButton( AppStrings.TIP_DRAW_RECTANGLE, drawRectangleIcon, new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { controller().modeDrawRectangle(); } @@ -191,6 +203,7 @@ public void actionPerformed(ActionEvent e) { drawPolygonButton = createToggleButton( AppStrings.TIP_DRAW_POLY, drawPolygonIcon, new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { controller().modeDrawPolygon(); } @@ -198,6 +211,7 @@ public void actionPerformed(ActionEvent e) { drawLineStringButton = createToggleButton( AppStrings.TIP_DRAW_LINE, drawLineStringIcon, new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { controller().modeDrawLineString(); } @@ -205,6 +219,7 @@ public void actionPerformed(ActionEvent e) { drawPointButton = createToggleButton( AppStrings.TIP_DRAW_POINT, drawPointIcon, new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { controller().modeDrawPoint(); } @@ -212,6 +227,7 @@ public void actionPerformed(ActionEvent e) { infoButton = createToggleButton( AppStrings.TIP_INFO, infoIcon, new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { controller().modeInfo(); } @@ -219,6 +235,7 @@ public void actionPerformed(ActionEvent e) { zoomButton = createToggleButton( AppStrings.TIP_ZOOM, zoomIcon, new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { controller().modeZoomIn(); } @@ -226,6 +243,7 @@ public void actionPerformed(ActionEvent e) { panButton = createToggleButton( AppStrings.TIP_PAN, panIcon, new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { controller().modePan(); } @@ -234,6 +252,7 @@ public void actionPerformed(ActionEvent e) { btnEditVertex = createToggleButton( AppStrings.TIP_MOVE_VERTEX, moveVertexIcon, new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { controller().modeEditVertex(); } @@ -242,6 +261,7 @@ public void actionPerformed(ActionEvent e) { btnMove = createToggleButton( AppStrings.TIP_MOVE, AppIcons.MOVE, new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { controller().modeMove(); } @@ -251,6 +271,7 @@ public void actionPerformed(ActionEvent e) { AppStrings.TIP_EXTRACT_COMPONENTS, new ImageIcon(this.getClass().getResource("ExtractComponent.png")), new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { controller().modeExtractComponent(); @@ -261,6 +282,7 @@ public void actionPerformed(ActionEvent e) AppStrings.TIP_DELETE_VERTEX_COMPONENT, new ImageIcon(this.getClass().getResource("DeleteVertex.png")), new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { controller().modeDeleteVertex(); }}); diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/JTSTestBuilder_AboutBox.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/JTSTestBuilder_AboutBox.java index 2f5b419627..b97a1412e2 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/JTSTestBuilder_AboutBox.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/JTSTestBuilder_AboutBox.java @@ -111,6 +111,7 @@ private void jbInit() throws Exception { } /**Overridden so we can exit when window is closed*/ + @Override protected void processWindowEvent(WindowEvent e) { if (e.getID() == WindowEvent.WINDOW_CLOSING) { cancel(); @@ -124,6 +125,7 @@ void cancel() { } /**Close the dialog on a button event*/ + @Override public void actionPerformed(ActionEvent e) { if (e.getSource() == button1) { cancel(); diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/LayerListPanel.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/LayerListPanel.java index 1894ce3c76..9eba345ed3 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/LayerListPanel.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/LayerListPanel.java @@ -97,6 +97,7 @@ private void uiInit() throws Exception { btnCopy = SwingUtil.createButton(AppIcons.ADD, "Copy layer to a new layer", new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { layerCopy(); } @@ -106,6 +107,7 @@ public void actionPerformed(ActionEvent e) { btnInspect = SwingUtil.createButton(AppIcons.GEOM_INSPECT, "Inspect layer geometry", new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { layerInspect(); } @@ -115,6 +117,7 @@ public void actionPerformed(ActionEvent e) { btnPaste = SwingUtil.createButton(AppIcons.PASTE, "Paste geometry into layer", new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { layerPaste(focusLayer); } @@ -123,6 +126,7 @@ public void actionPerformed(ActionEvent e) { btnUp = SwingUtil.createButton(AppIcons.UP, "Move layer up", new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { layerUp(focusLayer); } @@ -131,6 +135,7 @@ public void actionPerformed(ActionEvent e) { btnDown = SwingUtil.createButton(AppIcons.DOWN, "Move layer down", new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { layerDown(focusLayer); } @@ -140,6 +145,7 @@ public void actionPerformed(ActionEvent e) { btnDelete = SwingUtil.createButton(AppIcons.DELETE, AppStrings.TIP_LAYER_CLEAR, new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { if (SwingUtil.isCtlKeyPressed(e)) { layerDelete(focusLayer); @@ -315,6 +321,7 @@ class LayerItemPanel extends JPanel { self = this; } + @Override public String getToolTipText(MouseEvent e) { return layer.getNameInfo(); } @@ -352,6 +359,7 @@ private void uiInit() throws Exception { add(checkbox); checkbox.setAlignmentX(Component.LEFT_ALIGNMENT); checkbox.addActionListener(new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { layerVisAction(); } @@ -369,7 +377,8 @@ public void actionPerformed(ActionEvent e) { lblName.addMouseListener(new HighlightMouseListener(this)); lblName.addMouseListener(new MouseAdapter() { - public void mouseClicked(MouseEvent e) + @Override + public void mouseClicked(MouseEvent e) { lyrListPanel.setLayerFocus(self); } @@ -408,6 +417,7 @@ class HighlightMouseListener extends MouseAdapter { this.comp = comp; } + @Override public void mouseEntered(MouseEvent e) { if (comp.isFocusLayer()) return; comp.setBackground(CLR_HIGHLIGHT); @@ -415,6 +425,7 @@ public void mouseEntered(MouseEvent e) { comp.revalidate(); } + @Override public void mouseExited(MouseEvent e) { if (comp.isFocusLayer()) return; comp.setBackground(AppColors.BACKGROUND); @@ -434,6 +445,7 @@ public LayerName(Layer layer) { setToolTipText(layer.getName()); } + @Override public String getToolTipText(MouseEvent e) { return layer.getNameSummary(); } @@ -459,6 +471,7 @@ public LayerStyleSwatchControl(Layer layer) { setToolTipText(layer.getName()); } + @Override public String getToolTipText(MouseEvent e) { return layer.getNameSummary(); } diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/LayerStylePanel.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/LayerStylePanel.java index a59194f0e5..ac59af8266 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/LayerStylePanel.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/LayerStylePanel.java @@ -147,6 +147,7 @@ private void uiInit() throws Exception { add( stylePanel(), BorderLayout.CENTER ); JButton btnReset = SwingUtil.createButton(AppIcons.CLEAR, "Reset style to default", new ActionListener() { + @Override public void actionPerformed(ActionEvent arg0) { if (layer == null) return; layer.resetStyle(); @@ -187,6 +188,7 @@ private JPanel stylePanel() { cbShift.setAlignmentX(Component.LEFT_ALIGNMENT); cbShift.setText("Shift"); cbShift.addActionListener(new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { if (layer == null) return; layer.getLayerStyle().setShift(cbShift.isSelected()); @@ -197,12 +199,15 @@ public void actionPerformed(ActionEvent e) { addRow("Name", txtName, cbShift); txtName.getDocument().addDocumentListener(new DocumentListener() { + @Override public void changedUpdate(DocumentEvent e) { update(); } + @Override public void removeUpdate(DocumentEvent e) { update(); } + @Override public void insertUpdate(DocumentEvent e) { update(); } @@ -220,6 +225,7 @@ public void update() { cbVertex.setToolTipText(AppStrings.TIP_STYLE_VERTEX_ENABLE); cbVertex.setAlignmentX(Component.LEFT_ALIGNMENT); cbVertex.addActionListener(new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { if (layer == null) return; layer.getLayerStyle().setVertices(cbVertex.isSelected()); @@ -230,6 +236,7 @@ public void actionPerformed(ActionEvent e) { "Vertex", AppColors.GEOM_VIEW_BACKGROUND, new ColorControl.ColorListener() { + @Override public void colorChanged(Color clr) { if (layer == null) return; layer.getLayerStyle().setVertexColor(clr); @@ -243,6 +250,7 @@ public void colorChanged(Color clr) { spinVertexSize.setMaximumSize(new Dimension(40,16)); spinVertexSize.setAlignmentX(Component.LEFT_ALIGNMENT); spinVertexSize.addChangeListener(new ChangeListener() { + @Override public void stateChanged(ChangeEvent e) { int size = vertexSizeModel.getNumber().intValue(); layer.getLayerStyle().setVertexSize(size); @@ -254,6 +262,7 @@ public void stateChanged(ChangeEvent e) { cbVertexLabel.setText("Label"); cbVertexLabel.setAlignmentX(Component.LEFT_ALIGNMENT); cbVertexLabel.addActionListener(new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { if (layer == null) return; layer.getLayerStyle().setVertexLabels(cbVertexLabel.isSelected()); @@ -263,6 +272,7 @@ public void actionPerformed(ActionEvent e) { comboVertexSymbol = new JComboBox(vertexSymbolNames); comboVertexSymbol.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { JComboBox cb = (JComboBox)e.getSource(); int symType = getVertexSymbol(cb); @@ -280,6 +290,7 @@ public void actionPerformed(ActionEvent e) { cbStroked.setToolTipText(AppStrings.TIP_STYLE_LINE_ENABLE); cbStroked.setAlignmentX(Component.LEFT_ALIGNMENT); cbStroked.addActionListener(new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { geomStyle().setStroked(cbStroked.isSelected()); JTSTestBuilder.controller().geometryViewChanged(); @@ -290,6 +301,7 @@ public void actionPerformed(ActionEvent e) { "Line", AppColors.GEOM_VIEW_BACKGROUND, new ColorControl.ColorListener() { + @Override public void colorChanged(Color clr) { geomStyle().setLineColor(clr); layer.getLayerStyle().setColor(clr); @@ -299,6 +311,7 @@ public void colorChanged(Color clr) { } ); JButton btnVertexSynch = createSynchButton("^", "Synch Vertex Color", new ActionListener() { + @Override public void actionPerformed(ActionEvent arg0) { if (layer == null) return; Color clr = ColorControl.getColor(btnLineColor); @@ -317,6 +330,7 @@ public void actionPerformed(ActionEvent arg0) { spinnerLineWidth.setAlignmentX(Component.LEFT_ALIGNMENT); spinnerLineWidth.addChangeListener(new ChangeListener() { + @Override public void stateChanged(ChangeEvent e) { float width = lineWidthModel.getNumber().floatValue(); geomStyle().setStrokeWidth(width); @@ -326,6 +340,7 @@ public void stateChanged(ChangeEvent e) { }); sliderLineAlpha = createOpacitySlider(new ChangeListener() { + @Override public void stateChanged(ChangeEvent e) { JSlider source = (JSlider)e.getSource(); if (! source.getValueIsAdjusting()) { @@ -341,6 +356,7 @@ public void stateChanged(ChangeEvent e) { //cbDashed.setToolTipText(AppStrings.STYLE_VERTEX_ENABLE); cbDashed.setAlignmentX(Component.LEFT_ALIGNMENT); cbDashed.addActionListener(new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { if (layer == null) return; geomStyle().setDashed(cbDashed.isSelected()); @@ -352,6 +368,7 @@ public void actionPerformed(ActionEvent e) { //cbDashed.setToolTipText(AppStrings.STYLE_VERTEX_ENABLE); cbOffset.setAlignmentX(Component.LEFT_ALIGNMENT); cbOffset.addActionListener(new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { if (layer == null) return; layer.getLayerStyle().setOffset(cbOffset.isSelected()); @@ -363,6 +380,7 @@ public void actionPerformed(ActionEvent e) { spinOffsetSize.setMaximumSize(new Dimension(40,16)); spinOffsetSize.setAlignmentX(Component.LEFT_ALIGNMENT); spinOffsetSize.addChangeListener(new ChangeListener() { + @Override public void stateChanged(ChangeEvent e) { int size = offsetSizeModel.getNumber().intValue(); layer.getLayerStyle().setOffsetSize(size); @@ -379,6 +397,7 @@ public void stateChanged(ChangeEvent e) { cbEndpoint.setText("Endpoints"); cbEndpoint.setAlignmentX(Component.LEFT_ALIGNMENT); cbEndpoint.addActionListener(new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { if (layer == null) return; layer.getLayerStyle().setEndpoints(cbEndpoint.isSelected()); @@ -390,6 +409,7 @@ public void actionPerformed(ActionEvent e) { cbOrient.setText("Orientation"); cbOrient.setAlignmentX(Component.LEFT_ALIGNMENT); cbOrient.addActionListener(new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { if (layer == null) return; layer.getLayerStyle().setOrientations(cbOrient.isSelected()); @@ -401,6 +421,7 @@ public void actionPerformed(ActionEvent e) { cbStructure.setText("Structure"); cbStructure.setAlignmentX(Component.LEFT_ALIGNMENT); cbStructure.addActionListener(new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { if (layer == null) return; layer.getLayerStyle().setStructure(cbStructure.isSelected()); @@ -412,6 +433,7 @@ public void actionPerformed(ActionEvent e) { cbSegIndex.setText("Index"); cbSegIndex.setAlignmentX(Component.LEFT_ALIGNMENT); cbSegIndex.addActionListener(new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { if (layer == null) return; layer.getLayerStyle().setSegIndex(cbSegIndex.isSelected()); @@ -428,6 +450,7 @@ public void actionPerformed(ActionEvent e) { cbFilled.setToolTipText(AppStrings.TIP_STYLE_FILL_ENABLE); cbFilled.setAlignmentX(Component.LEFT_ALIGNMENT); cbFilled.addActionListener(new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { geomStyle().setFilled(cbFilled.isSelected()); JTSTestBuilder.controller().geometryViewChanged(); @@ -436,6 +459,7 @@ public void actionPerformed(ActionEvent e) { }); sliderFillAlpha = createOpacitySlider(new ChangeListener() { + @Override public void stateChanged(ChangeEvent e) { JSlider source = (JSlider)e.getSource(); if (! source.getValueIsAdjusting()) { @@ -450,6 +474,7 @@ public void stateChanged(ChangeEvent e) { "Fill", AppColors.GEOM_VIEW_BACKGROUND, new ColorControl.ColorListener() { + @Override public void colorChanged(Color clr) { geomStyle().setFillColor(clr); updateStyleControls(); @@ -459,6 +484,7 @@ public void colorChanged(Color clr) { } ); JButton btnLineSynch = createSynchButton("^", "Synch Line Color", new ActionListener() { + @Override public void actionPerformed(ActionEvent arg0) { Color clr = lineColorFromFill( ColorControl.getColor(btnFillColor)); geomStyle().setLineColor(clr ); @@ -473,6 +499,7 @@ public void actionPerformed(ActionEvent arg0) { comboPalette = new JComboBox(paletteNames); comboPalette.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { JComboBox cb = (JComboBox)e.getSource(); int fillType = getPaletteType(cb); @@ -490,6 +517,7 @@ public void actionPerformed(ActionEvent e) { //cbLabel.setToolTipText(AppStrings.TIP_STYLE_VERTEX_ENABLE); cbLabel.setAlignmentX(Component.LEFT_ALIGNMENT); cbLabel.addActionListener(new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { if (layer == null) return; layer.getLayerStyle().setLabel(cbLabel.isSelected()); @@ -500,6 +528,7 @@ public void actionPerformed(ActionEvent e) { "Label", AppColors.GEOM_VIEW_BACKGROUND, new ColorControl.ColorListener() { + @Override public void colorChanged(Color clr) { if (layer == null) return; layer.getLayerStyle().setLabelColor(clr); @@ -513,6 +542,7 @@ public void colorChanged(Color clr) { spinLabelSize.setMaximumSize(new Dimension(40,16)); spinLabelSize.setAlignmentX(Component.LEFT_ALIGNMENT); spinLabelSize.addChangeListener(new ChangeListener() { + @Override public void stateChanged(ChangeEvent e) { int size = labelSizeModel.getNumber().intValue(); layer.getLayerStyle().setLabelSize(size); diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/LoadTestCasesDialog.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/LoadTestCasesDialog.java index bcc52ef7ae..e46ee6e3fd 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/LoadTestCasesDialog.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/LoadTestCasesDialog.java @@ -68,6 +68,7 @@ void jbInit() throws Exception { btnCancel.setText("Cancel"); btnCancel.addActionListener(new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { btnCancel_actionPerformed(e); } @@ -75,6 +76,7 @@ public void actionPerformed(ActionEvent e) { btnOk.setText("Ok"); btnOk.addActionListener(new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { btnOk_actionPerformed(e); } diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/PrecisionModelDialog.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/PrecisionModelDialog.java index 2677f33536..abd31d67ec 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/PrecisionModelDialog.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/PrecisionModelDialog.java @@ -50,6 +50,7 @@ void jbInit() throws Exception { panel1.setLayout(borderLayout1); okButton.setText("OK"); okButton.addActionListener(new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { okButton_actionPerformed(e); } diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/PrecisionModelPanel.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/PrecisionModelPanel.java index e9558d8497..ee1cd2a6ef 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/PrecisionModelPanel.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/PrecisionModelPanel.java @@ -70,6 +70,7 @@ void jbInit() throws Exception { " * This is the default precision model used in JTS\n"); rbFixed.setText("Fixed"); rbFixed.addActionListener(new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { rbFixed_actionPerformed(e); } @@ -77,11 +78,13 @@ public void actionPerformed(ActionEvent e) { rbFloating.setText("Floating (Double)"); rbFloating.setToolTipText(""); rbFloating.addActionListener(new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { rbFloating_actionPerformed(e); } }); rbFloatingSingle.addActionListener(new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { rbFloatingSingle_actionPerformed(e); } diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/RelatePanel.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/RelatePanel.java index 7b2dee2a89..f9f2782171 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/RelatePanel.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/RelatePanel.java @@ -110,14 +110,17 @@ public class RelatePanel extends JPanel { private DocumentListener expectedImDocumentListener = new DocumentListener() { + @Override public void insertUpdate(DocumentEvent e) { expectedIntersectionMatrixChanged(); } + @Override public void removeUpdate(DocumentEvent e) { expectedIntersectionMatrixChanged(); } + @Override public void changedUpdate(DocumentEvent e) { expectedIntersectionMatrixChanged(); } diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ResultWKTPanel.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ResultWKTPanel.java index 225314e4dd..089482b0ee 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ResultWKTPanel.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ResultWKTPanel.java @@ -77,18 +77,21 @@ void jbInit() throws Exception { JButton copyButton = SwingUtil.createButton(AppIcons.COPY, "Copy Result (Ctl-click for formatted)", new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { rCopyButton_actionPerformed(e); } }); JButton copyToTestButton = SwingUtil.createButton(AppIcons.COPY_TO_TEST, "Copy Result to new Test", new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { JTSTestBuilderFrame.instance().copyResultToTest(); } }); JButton btnClearResult = SwingUtil.createButton(AppIcons.CUT, "Clear Result", new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { JTSTestBuilder.controller().clearResult(); } @@ -134,6 +137,7 @@ public void actionPerformed(ActionEvent e) { //------------------------------------- JButton btnInspect = SwingUtil.createButton(AppIcons.GEOM_INSPECT, "Inspect", new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { JTSTestBuilder.controller().inspectResult(); } diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ScalarFunctionPanel.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ScalarFunctionPanel.java index 4d28ffa262..eefb5db10f 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ScalarFunctionPanel.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ScalarFunctionPanel.java @@ -106,6 +106,7 @@ void jbInit() throws Exception { execButton = SwingUtil.createButton(AppIcons.EXECUTE, AppStrings.TIP_EXECUTE, new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { execButton_actionPerformed(e); } @@ -120,9 +121,11 @@ public void actionPerformed(ActionEvent e) { this.add(panelExecParam, BorderLayout.SOUTH); GeometryFunctionListener gfListener = new GeometryFunctionListener() { + @Override public void functionSelected(GeometryFunctionEvent e) { functionChanged(e.getFunction()); } + @Override public void functionInvoked(GeometryFunctionEvent e) { execFunction(e.getFunction(), false); } @@ -189,6 +192,7 @@ private Object[] OLDgetFunctionParams() return null; } + @Override public Object[] getFunctionParams() { if (currentFunc == null) return null; @@ -220,6 +224,7 @@ public String getOpName() { return currentFunc.getName(); } + @Override public GeometryFunction getFunction() { return currentFunc; } diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/SpatialFunctionPanel.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/SpatialFunctionPanel.java index 853c1305d6..c75b56aafa 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/SpatialFunctionPanel.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/SpatialFunctionPanel.java @@ -221,6 +221,7 @@ void uiInit() throws Exception { execButton = SwingUtil.createButton(AppIcons.EXECUTE, AppStrings.TIP_EXECUTE, new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { execFunction(false); } @@ -229,6 +230,7 @@ public void actionPerformed(ActionEvent e) { execToNewButton = SwingUtil.createButton("New", AppIcons.EXECUTE, "Compute function result to a new case", new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { execFunction(true); } @@ -237,6 +239,7 @@ public void actionPerformed(ActionEvent e) { JButton btnShowExecExt = SwingUtil.createButton(expandDownIcon, "Show extended/meta Compute tools", new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { clearExtended(); panelExecMeta.setVisible(! panelExecMeta.isVisible()); @@ -285,9 +288,11 @@ public void actionPerformed(ActionEvent e) { this.add(panelExecParam, BorderLayout.SOUTH); GeometryFunctionListener gfListener = new GeometryFunctionListener() { + @Override public void functionSelected(GeometryFunctionEvent e) { functionChanged(e.getFunction()); } + @Override public void functionInvoked(GeometryFunctionEvent e) { execFunction(e.getFunction(), false); } @@ -444,6 +449,7 @@ public void clearFunction() { setCurrentFunction(null); } + @Override public Object[] getFunctionParams() { if (currentFunc == null) return null; @@ -488,6 +494,7 @@ public boolean isAutoExecute() return cbExecAuto.isSelected(); } + @Override public GeometryFunction getFunction() { return currentFunc; } diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/TestCasePanel.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/TestCasePanel.java index dca7dc145f..8d6244e110 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/TestCasePanel.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/TestCasePanel.java @@ -217,9 +217,11 @@ private void jbInit() throws Exception { editPanel.addMouseMotionListener( new java.awt.event.MouseMotionAdapter() { + @Override public void mouseMoved(MouseEvent e) { editPanel_mouseMoved(e); } + @Override public void mouseDragged(MouseEvent e) { editPanel_mouseMoved(e); } @@ -230,12 +232,14 @@ public void mouseDragged(MouseEvent e) { btnRunTests.addActionListener( new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { btnRunTests_actionPerformed(e); } }); validPanel.addValidPanelListener( new ValidPanelListener() { + @Override public void setHighlightPerformed(ValidPanelEvent e) { validPanel_setHighlightPerformed(e); } @@ -244,6 +248,7 @@ public void setHighlightPerformed(ValidPanelEvent e) { txtDesc.addFocusListener( new java.awt.event.FocusAdapter() { + @Override public void focusLost(FocusEvent e) { txtDesc_focusLost(e); } @@ -251,6 +256,7 @@ public void focusLost(FocusEvent e) { jTabbedPane1.addChangeListener( new javax.swing.event.ChangeListener() { + @Override public void stateChanged(ChangeEvent e) { jTabbedPane1_stateChanged(e); } @@ -287,6 +293,7 @@ public void stateChanged(ChangeEvent e) { cbDisplayAB.setSelected(true); cbDisplayAB.setToolTipText("Display A and B"); cbDisplayAB.addActionListener(new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { JTSTestBuilderController.editPanel().setShowingInput(cbDisplayAB.isSelected()); } @@ -298,6 +305,7 @@ public void actionPerformed(ActionEvent e) { cbDisplayGrid.setSelected(true); cbDisplayGrid.setToolTipText("Display Grid"); cbDisplayGrid.addActionListener(new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { JTSTestBuilderController.editPanel().setShowingGrid(cbDisplayGrid.isSelected()); } @@ -324,6 +332,7 @@ public void actionPerformed(ActionEvent e) { JButton btnSaveImage = SwingUtil.createButton( AppIcons.SAVE_IMAGE, AppStrings.TIP_SAVE_IMAGE, new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { if (SwingUtil.isCtlKeyPressed(e)) { JTSTestBuilder.controller().saveImageAsPNG(); diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/TestCaseTextDialog.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/TestCaseTextDialog.java index a0f3737231..75deab488d 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/TestCaseTextDialog.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/TestCaseTextDialog.java @@ -90,6 +90,7 @@ void jbInit() throws Exception { btnCopy.setText("Copy"); btnCopy.addActionListener(new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { btnSelect_actionPerformed(e); } @@ -98,6 +99,7 @@ public void actionPerformed(ActionEvent e) { btnOk.setText("Close"); btnOk.addActionListener(new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { btnOk_actionPerformed(e); } @@ -106,6 +108,7 @@ public void actionPerformed(ActionEvent e) { rbXML.setToolTipText(""); rbXML.addActionListener(new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { rbXML_actionPerformed(e); } @@ -114,6 +117,7 @@ public void actionPerformed(ActionEvent e) { rbXMLWKB.setToolTipText(""); rbXMLWKB.addActionListener(new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { rbXMLWKB_actionPerformed(e); } @@ -121,6 +125,7 @@ public void actionPerformed(ActionEvent e) { rbSVG.setText("SVG"); rbSVG.setToolTipText(""); rbSVG.addActionListener(new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { rbSVG_actionPerformed(e); } @@ -129,6 +134,7 @@ public void actionPerformed(ActionEvent e) { rbTestCaseJava.setText("TestCase Java"); rbTestCaseJava.setToolTipText(""); rbTestCaseJava.addActionListener(new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { rbTestCaseJava_actionPerformed(e); } @@ -138,6 +144,7 @@ public void actionPerformed(ActionEvent e) { rbWKT.setText("WKT"); rbWKT.addActionListener(new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { rbWKT_actionPerformed(e); } @@ -145,6 +152,7 @@ public void actionPerformed(ActionEvent e) { rbWKTFormatted.setText("WKT-Formatted"); rbWKTFormatted.addActionListener(new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { rbWKTFormatted_actionPerformed(e); } @@ -152,12 +160,14 @@ public void actionPerformed(ActionEvent e) { rbWKB.setText("WKB"); rbWKB.addActionListener(new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { rbWKB_actionPerformed(e); } }); rbGML.setText("GML"); rbGML.addActionListener(new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { rbGML_actionPerformed(e); } diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/TestListPanel.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/TestListPanel.java index 65d57e19f2..1dac0bfc7b 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/TestListPanel.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/TestListPanel.java @@ -56,6 +56,7 @@ private class TestListCellRenderer extends JLabel implements ListCellRenderer { private final ImageIcon clearIcon = new ImageIcon(this.getClass().getResource("clear.gif")); */ + @Override public Component getListCellRendererComponent( JList list, Object value, @@ -146,6 +147,7 @@ private void jbInit() throws Exception { private void registerListSelectionListener() { list.getSelectionModel().addListSelectionListener(new ListSelectionListener() { + @Override public void valueChanged(ListSelectionEvent e) { if (list.getSelectedValue() == null) return; diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ValidPanel.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ValidPanel.java index e9bf9a801e..22b9e9708c 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ValidPanel.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ValidPanel.java @@ -79,6 +79,7 @@ void jbInit() throws Exception { JButton btnValidate = new JButton(); btnValidate.setText("Valid?"); btnValidate.addActionListener(new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { btnValidate_actionPerformed(e); } @@ -86,6 +87,7 @@ public void actionPerformed(ActionEvent e) { JButton btnSimple = new JButton(); btnSimple.setText("Simple?"); btnSimple.addActionListener(new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { btnSimple_actionPerformed(e); } @@ -94,6 +96,7 @@ public void actionPerformed(ActionEvent e) { JButton btnClear = new JButton(); btnClear.setText("Clear"); btnClear.addActionListener(new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { clearAll(); } @@ -139,6 +142,7 @@ public void actionPerformed(ActionEvent e) { btnClearMark.setToolTipText(""); btnClearMark.setText("Clear Mark"); btnClearMark.addActionListener(new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { clearMark(); } @@ -147,6 +151,7 @@ public void actionPerformed(ActionEvent e) { btnSetMark.setToolTipText(""); btnSetMark.setText("Set Mark"); btnSetMark.addActionListener(new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { btnSetMark_actionPerformed(e); } diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/WKTPanel.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/WKTPanel.java index 7b339ecbc2..68ba4fc008 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/WKTPanel.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/WKTPanel.java @@ -133,6 +133,7 @@ void uiInit() throws Exception { exchangeButton.setIcon(AppIcons.GEOM_EXCHANGE); JButton btnUndo = SwingUtil.createButton(AppIcons.UNDO, "Undo", new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { tbModel.getGeometryEditModel().undo(); } @@ -209,6 +210,7 @@ public void mouseClicked(MouseEvent arg0) { aRB.setAlignmentX(LEFT_ALIGNMENT); aRB.setSelected(true); aRB.addActionListener(new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { setFocusGeometry(0); } @@ -245,6 +247,7 @@ public void actionPerformed(ActionEvent e) { //bLabelPanel.add(bRB); bRB.setAlignmentX(LEFT_ALIGNMENT); bRB.addActionListener(new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { setFocusGeometry(1); } @@ -303,54 +306,63 @@ public void actionPerformed(ActionEvent e) { loadButton.addActionListener( new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { loadButton_actionPerformed(e); } }); inspectButton.addActionListener( new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { JTSTestBuilder.controller().inspectGeometry(); } }); exchangeButton.addActionListener( new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { JTSTestBuilder.controller().exchangeGeometry(); } }); aCopyButton.addActionListener( new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { aCopyButton_actionPerformed(e); } }); aPasteButton.addActionListener( new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { aPasteButton_actionPerformed(e); } }); aCutButton.addActionListener( new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { aCutButton_actionPerformed(e); } }); bCopyButton.addActionListener( new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { bCopyButton_actionPerformed(e); } }); bPasteButton.addActionListener( new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { bPasteButton_actionPerformed(e); } }); bCutButton.addActionListener( new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { bCutButton_actionPerformed(e); } @@ -485,6 +497,7 @@ private void initFileDrop(Component comp, int index) final int geomIndex = index; new FileDrop(comp, new FileDrop.Listener() { + @Override public void filesDropped(java.io.File[] files) { try { tbModel.loadMultipleGeometriesFromFile(geomIndex, files[0].getCanonicalPath()); diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/controller/ResultController.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/controller/ResultController.java index 0e01ee10e3..149a060f68 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/controller/ResultController.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/controller/ResultController.java @@ -134,6 +134,7 @@ private void runFunctionWorker(final GeometryFunctionInvocation functionInvoc, f worker = new SwingWorker() { Stopwatch timer; + @Override public Object construct() { return computeResult(); @@ -162,6 +163,7 @@ private Object computeResult() { return result; } + @Override public void finished() { stopFunctionMonitor(); resetUI(); @@ -189,6 +191,7 @@ private void startFunctionMonitor() funcTimer.stop(); } funcTimer = new Timer(TIMER_DELAY_IN_MILLIS, new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { // Stopwatch timer = testCasePanel.getSpatialFunctionPanel().getTimer(); runMillis += TIMER_DELAY_IN_MILLIS; diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/geom/AdjacentVertexFinder.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/geom/AdjacentVertexFinder.java index e5865045b2..c71f2d4cb3 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/geom/AdjacentVertexFinder.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/geom/AdjacentVertexFinder.java @@ -64,6 +64,7 @@ public AdjacentVertexFilter(Coordinate basePt) this.basePt = basePt; } + @Override public void filter(CoordinateSequence seq, int i) { Coordinate p = seq.getCoordinate(i); @@ -83,8 +84,10 @@ public Coordinate[] getVertices() return CoordinateArrays.toCoordinateArray(adjVerts); } + @Override public boolean isDone() { return false; } + @Override public boolean isGeometryChanged() { return false; } } diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/geom/ConstrainedInteriorPoint.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/geom/ConstrainedInteriorPoint.java index 1e0b0817fc..6b9721717b 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/geom/ConstrainedInteriorPoint.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/geom/ConstrainedInteriorPoint.java @@ -173,6 +173,7 @@ private boolean crosses(Coordinate p0, Coordinate p1, double Y) { } private static class DoubleComparator implements Comparator { + @Override public int compare(Double v1, Double v2) { return v1 < v2 ? -1 : v1 > v2 ? +1 : 0; } diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/geom/GeometryBoxDeleter.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/geom/GeometryBoxDeleter.java index 0952546113..e4e2356cb0 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/geom/GeometryBoxDeleter.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/geom/GeometryBoxDeleter.java @@ -100,6 +100,7 @@ public BoxDeleteComponentOperation(Envelope env, boolean deleteIntersecting) public boolean isEdited() { return isEdited; } + @Override public Geometry edit(Geometry geometry, GeometryFactory factory) { // Allow any number of components to be deleted @@ -145,6 +146,7 @@ public BoxDeleteVertexOperation(Envelope env) public boolean isEdited() { return isEdited; } + @Override public Coordinate[] edit(Coordinate[] coords, Geometry geometry) { diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/geom/GeometryComponentDeleter.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/geom/GeometryComponentDeleter.java index 5df0488692..21aa0edd4b 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/geom/GeometryComponentDeleter.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/geom/GeometryComponentDeleter.java @@ -47,6 +47,7 @@ public DeleteComponentOperation(Geometry component) public boolean isEdited() { return isEdited; } + @Override public Geometry edit(Geometry geometry, GeometryFactory factory) { if (geometry == component) { diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/geom/GeometryComponentTransformer.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/geom/GeometryComponentTransformer.java index 66513d2f80..e8d30febab 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/geom/GeometryComponentTransformer.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/geom/GeometryComponentTransformer.java @@ -57,6 +57,7 @@ public TransformOperation(Geometry component, AffineTransformation trans) public boolean isEdited() { return isEdited; } + @Override public Geometry edit(Geometry geometry, GeometryFactory factory) { if (geometry == component) { diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/geom/GeometryPointLocater.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/geom/GeometryPointLocater.java index e24344e812..2c158bf180 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/geom/GeometryPointLocater.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/geom/GeometryPointLocater.java @@ -105,6 +105,7 @@ public NearestSegmentLocationFilter(Coordinate testPt, boolean vertexOnly, doub this.vertexOnly = vertexOnly; } + @Override public void filter(Geometry geom) { if (! (geom instanceof LineString)) return; diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/geom/GeometryVertexDeleter.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/geom/GeometryVertexDeleter.java index ed13a0c308..a2f51fb020 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/geom/GeometryVertexDeleter.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/geom/GeometryVertexDeleter.java @@ -42,6 +42,7 @@ public DeleteVertexOperation(LineString line, int vertexIndex) this.vertexIndex = vertexIndex; } + @Override public Coordinate[] edit(Coordinate[] coords, Geometry geometry) { diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/geom/GeometryVertexInserter.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/geom/GeometryVertexInserter.java index cc30e1e378..e67315acbf 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/geom/GeometryVertexInserter.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/geom/GeometryVertexInserter.java @@ -43,6 +43,7 @@ public InsertVertexOperation(LineString line, int segIndex, Coordinate newVertex this.newVertex = newVertex; } + @Override public Coordinate[] edit(Coordinate[] coords, Geometry geometry) { diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/geom/GeometryVertexMover.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/geom/GeometryVertexMover.java index 4ea5bb1ed5..fd2925b66f 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/geom/GeometryVertexMover.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/geom/GeometryVertexMover.java @@ -38,6 +38,7 @@ public MoveVertexOperation(Coordinate fromLoc, Coordinate toLoc) this.toLoc = toLoc; } + @Override public Coordinate[] edit(Coordinate[] coords, Geometry geometry) { diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/geom/NearestPointFinder.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/geom/NearestPointFinder.java index a4fb3bd02c..92bf7ea441 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/geom/NearestPointFinder.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/geom/NearestPointFinder.java @@ -51,6 +51,7 @@ public NearestPointFilter(Coordinate basePt, double tolerance) this.tolerance = tolerance; } + @Override public void filter(CoordinateSequence seq, int i) { Coordinate p = seq.getCoordinate(i); @@ -68,8 +69,10 @@ public Coordinate getNearestPoint() { return nearestPt; } + @Override public boolean isDone() { return false; } + @Override public boolean isGeometryChanged() { return false; } } diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/geom/VertexLocater.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/geom/VertexLocater.java index 5ae86fa892..892a255a0a 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/geom/VertexLocater.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/geom/VertexLocater.java @@ -68,6 +68,7 @@ public NearestVertexFilter(Coordinate basePt, double tolerance) this.tolerance = tolerance; } + @Override public void filter(CoordinateSequence seq, int i) { Coordinate p = seq.getCoordinate(i); @@ -85,8 +86,10 @@ public Coordinate getVertex() } public int getIndex() { return vertexIndex; } + @Override public boolean isDone() { return nearestPt != null; } + @Override public boolean isGeometryChanged() { return false; } } static class NearVerticesFilter implements CoordinateSequenceFilter @@ -101,6 +104,7 @@ public NearVerticesFilter(Coordinate queryPt, double tolerance) this.tolerance = tolerance; } + @Override public void filter(CoordinateSequence seq, int i) { Coordinate p = seq.getCoordinate(i); @@ -116,12 +120,14 @@ public List getLocations() return locations; } + @Override public boolean isDone() { // evaluate all points return false; } + @Override public boolean isGeometryChanged() { return false; } } diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/io/shapefile/MultiLineHandler.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/io/shapefile/MultiLineHandler.java index 4667548826..2fe9d9de0a 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/io/shapefile/MultiLineHandler.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/io/shapefile/MultiLineHandler.java @@ -52,6 +52,7 @@ public MultiLineHandler(int type) throws InvalidShapefileException } + @Override public Geometry read( EndianDataInputStream file , GeometryFactory geometryFactory, int contentLength) throws IOException,InvalidShapefileException { @@ -186,10 +187,12 @@ public Geometry read( EndianDataInputStream file , GeometryFactory geometryFacto /** * Get the type of shape stored (Shapefile.ARC) */ + @Override public int getShapeType(){ return myShapeType; } + @Override public int getLength(Geometry geometry){ MultiLineString multi = (MultiLineString) geometry; diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/io/shapefile/MultiPointHandler.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/io/shapefile/MultiPointHandler.java index 83d63060d0..083abaccc6 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/io/shapefile/MultiPointHandler.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/io/shapefile/MultiPointHandler.java @@ -55,6 +55,7 @@ public MultiPointHandler(int type) throws InvalidShapefileException myShapeType = type; } + @Override public Geometry read(EndianDataInputStream file,GeometryFactory geometryFactory,int contentLength) throws IOException,InvalidShapefileException{ //file.setLittleEndianMode(true); @@ -186,6 +187,7 @@ public Geometry read(EndianDataInputStream file,GeometryFactory geometryFactory, * Returns the shapefile shape type value for a point * @return int Shapefile.POINT */ + @Override public int getShapeType(){ return myShapeType; } @@ -194,6 +196,7 @@ public int getShapeType(){ * Calcuates the record length of this object. * @return int The length of the record that this shapepoint will take up in a shapefile **/ + @Override public int getLength(Geometry geometry){ MultiPoint mp = (MultiPoint) geometry; diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/io/shapefile/PointHandler.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/io/shapefile/PointHandler.java index 28c62f28c8..d891fdd6c0 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/io/shapefile/PointHandler.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/io/shapefile/PointHandler.java @@ -46,6 +46,7 @@ public PointHandler() myShapeType = 1; //2d } + @Override public Geometry read(EndianDataInputStream file,GeometryFactory geometryFactory,int contentLength) throws IOException,InvalidShapefileException { // file.setLittleEndianMode(true); @@ -88,7 +89,8 @@ public Geometry read(EndianDataInputStream file,GeometryFactory geometryFactory, * Returns the shapefile shape type value for a point * @return int Shapefile.POINT */ - public int getShapeType(){ + @Override + public int getShapeType(){ return myShapeType; } @@ -96,6 +98,7 @@ public int getShapeType(){ * Calcuates the record length of this object. * @return int The length of the record that this shapepoint will take up in a shapefile **/ + @Override public int getLength(Geometry geometry){ if (myShapeType == Shapefile.POINT) return 10; diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/io/shapefile/PolygonHandler.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/io/shapefile/PolygonHandler.java index 7138304817..dcb9d94959 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/io/shapefile/PolygonHandler.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/io/shapefile/PolygonHandler.java @@ -75,6 +75,7 @@ boolean pointInList(Coordinate testPoint, Coordinate[] pointList) return false; } + @Override public Geometry read( EndianDataInputStream file , GeometryFactory geometryFactory, int contentLength) throws IOException, InvalidShapefileException { @@ -297,9 +298,11 @@ private static int findIndex(ArrayList list, Object o) } + @Override public int getShapeType(){ return myShapeType; } + @Override public int getLength(Geometry geometry){ int nrings=0; diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/model/GeometryStretcherView.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/model/GeometryStretcherView.java index 85d440fbd6..b4f6831d50 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/model/GeometryStretcherView.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/model/GeometryStretcherView.java @@ -137,6 +137,7 @@ public StretchedGeometryContainer(int index) this.index = index; } + @Override public Geometry getGeometry() { return getStretchedGeometry(index); diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/model/IndexedGeometryContainer.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/model/IndexedGeometryContainer.java index e317601482..6a15f6b631 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/model/IndexedGeometryContainer.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/model/IndexedGeometryContainer.java @@ -26,6 +26,7 @@ public IndexedGeometryContainer(GeometryEditModel geomModel, int index) { this.index = index; } + @Override public Geometry getGeometry() { return geomModel.getGeometry(index); diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/model/ListGeometryContainer.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/model/ListGeometryContainer.java index 4ebd23c1eb..9f1a193e91 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/model/ListGeometryContainer.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/model/ListGeometryContainer.java @@ -31,11 +31,13 @@ public void add(Geometry geom) { cache = null; } + @Override public void clear() { cache = null; geomList.clear(); } + @Override public Geometry getGeometry() { if ( cache == null ) { cache = createCache(geomList); diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/model/ResultGeometryContainer.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/model/ResultGeometryContainer.java index f42410cc18..e851fa18a2 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/model/ResultGeometryContainer.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/model/ResultGeometryContainer.java @@ -24,6 +24,7 @@ public ResultGeometryContainer(GeometryEditModel geomModel) { this.geomModel = geomModel; } + @Override public Geometry getGeometry() { return geomModel.getResult(); diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/model/StaticGeometryContainer.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/model/StaticGeometryContainer.java index 219d5aa3e8..1562e43a1e 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/model/StaticGeometryContainer.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/model/StaticGeometryContainer.java @@ -23,6 +23,7 @@ public StaticGeometryContainer(Geometry geometry) this.geometry = geometry; } + @Override public Geometry getGeometry() { return geometry; } diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/model/TestBuilderModel.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/model/TestBuilderModel.java index 5d09c5ca04..923e7791fd 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/model/TestBuilderModel.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/model/TestBuilderModel.java @@ -241,6 +241,7 @@ public void loadGeometryText(String wktA, String wktB) throws ParseException, IO //============================================================= private CaseList caseList = new CaseList(new CaseList.CaseFactory() { + @Override public TestCaseEdit create() { return new TestCaseEdit(precisionModel); } diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/model/TestCaseEdit.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/model/TestCaseEdit.java index 1a98ada0d0..c2910f5b8c 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/model/TestCaseEdit.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/model/TestCaseEdit.java @@ -69,10 +69,12 @@ private static Geometry cloneGeometry(Geometry geom) return (Geometry) geom.clone(); } + @Override public void setGeometry(int i, Geometry geom) { testable.setGeometry(i, geom); } + @Override public void setName(String name) { testable.setName(name); } @@ -91,6 +93,7 @@ public void setResult(Geometry geom) public void setOpName(String name) { opName = name; } + @Override public Geometry getGeometry(int i) { // return geom[i]; return testable.getGeometry(i); @@ -102,25 +105,31 @@ public Testable getTestable() { } + @Override public String getName() { return testable.getName(); } + @Override public IntersectionMatrix getIntersectionMatrix() { return testable.getIntersectionMatrix(); } + @Override public void setIntersectionMatrix(IntersectionMatrix im) { testable.setIntersectionMatrix(im); } + @Override public String getDescription() { return testable.getDescription(); } + @Override public String getWellKnownText(int i) { return testable.getWellKnownText(i); } + @Override public void initGeometry() throws ParseException { testable.initGeometry(); } diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/model/TestRunnerTestCaseAdapter.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/model/TestRunnerTestCaseAdapter.java index ff326cdd4f..83e1e39020 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/model/TestRunnerTestCaseAdapter.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/model/TestRunnerTestCaseAdapter.java @@ -43,6 +43,7 @@ public TestRunnerTestCaseAdapter(org.locationtech.jtstest.testrunner.TestCase te this.testCase = testCase; } + @Override public void setGeometry(int index, Geometry g) { if (index == 0) { testCase.setGeometryA(g); @@ -55,8 +56,10 @@ else if (index == 1) { } } + @Override public void setIntersectionMatrix(IntersectionMatrix im) { } + @Override public void setName(String name) { testCase.setDescription(name); } @@ -120,10 +123,12 @@ public String getFailedMsg() { return ""; } + @Override public String getName() { return testCase.getDescription(); } + @Override public Geometry getGeometry(int index) { if (index == 0) { return testCase.getGeometryA(); @@ -135,10 +140,12 @@ else if (index == 1) { return null; } + @Override public IntersectionMatrix getIntersectionMatrix() { return testCase.getGeometryA().relate(testCase.getGeometryB()); } + @Override public String getDescription() { return testCase.getDescription(); } @@ -156,6 +163,7 @@ public boolean isPassed() { return true; } + @Override public String getWellKnownText(int index) { if (index == 0) { if (testCase.getGeometryA() == null) { @@ -214,6 +222,7 @@ public void runTest() throws ParseException { testCase.run(); } + @Override public void initGeometry() throws ParseException { } public Geometry toGeometry(Test test) { diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/topostretch/GeometryVerticesMover.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/topostretch/GeometryVerticesMover.java index 789478dcc1..84996db196 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/topostretch/GeometryVerticesMover.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/topostretch/GeometryVerticesMover.java @@ -62,6 +62,7 @@ public MoveVerticesOperation(Map moves) } + @Override public Coordinate[] edit(Coordinate[] coords, Geometry geometry) { diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/topostretch/TopologyStretcher.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/topostretch/TopologyStretcher.java index 5dbd701038..1ef9bf86dd 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/topostretch/TopologyStretcher.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/topostretch/TopologyStretcher.java @@ -169,6 +169,7 @@ public VertexInMaskCountCoordinateFilter(Envelope mask) this.mask = mask; } + @Override public void filter(Coordinate coord) { if (mask.contains(coord)) diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/ClipImage.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/ClipImage.java index 82c9f619d4..12714cd109 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/ClipImage.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/ClipImage.java @@ -27,16 +27,19 @@ public ClipImage(byte[] im) image = im; } + @Override public DataFlavor[] getTransferDataFlavors() { return new DataFlavor[] { DataFlavor.imageFlavor }; } + @Override public boolean isDataFlavorSupported(DataFlavor flavor) { return DataFlavor.imageFlavor.equals(flavor); } + @Override public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException { @@ -45,6 +48,7 @@ public Object getTransferData(DataFlavor flavor) throws return Toolkit.getDefaultToolkit().createImage(image); } + @Override public void lostOwnership(java.awt.datatransfer.Clipboard clip, java.awt.datatransfer.Transferable tr) diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/GeometryTransferable.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/GeometryTransferable.java index 4a24d39447..e5f3da4e23 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/GeometryTransferable.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/GeometryTransferable.java @@ -41,10 +41,12 @@ public GeometryTransferable(Geometry geom, boolean isFormatted) { this.isFormatted = isFormatted; } + @Override public DataFlavor[] getTransferDataFlavors() { return flavors; } + @Override public boolean isDataFlavorSupported(DataFlavor flavor) { for (int i = 0; i < flavors.length; i++) { if (flavor.equals(flavors[i])) { @@ -54,6 +56,7 @@ public boolean isDataFlavorSupported(DataFlavor flavor) { return false; } + @Override public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException { diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/SwingUtil.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/SwingUtil.java index e0549cfd84..df8d8c68f5 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/SwingUtil.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/SwingUtil.java @@ -61,9 +61,11 @@ public static FileFilter createFileFilter(final String description, String exten { final String dotExt = extension.startsWith(".") ? extension : "." + extension; FileFilter ff = new FileFilter() { + @Override public String getDescription() { return description; } + @Override public boolean accept(File f) { return f.isDirectory() || f.toString().toLowerCase().endsWith(dotExt); } diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/SwingWorker.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/SwingWorker.java index 9836018bea..ee169674b6 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/SwingWorker.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/SwingWorker.java @@ -112,10 +112,12 @@ public Object get() { */ public SwingWorker() { final Runnable doFinished = new Runnable() { + @Override public void run() { finished(); } }; Runnable doConstruct = new Runnable() { + @Override public void run() { try { setValue(construct()); diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/Viewport.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/Viewport.java index 027847b778..3a234d5a7b 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/Viewport.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/Viewport.java @@ -207,6 +207,7 @@ public Coordinate toModelCoordinate(Point2D viewPt) { return new Coordinate(p.getX(), p.getY()); } + @Override public void transform(Coordinate modelCoordinate, Point2D point) { point.setLocation(modelCoordinate.x, modelCoordinate.y); diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/dnd/FileDrop.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/dnd/FileDrop.java index 3c4fb9e08f..24caab6415 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/dnd/FileDrop.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/dnd/FileDrop.java @@ -267,7 +267,7 @@ public FileDrop( if( supportsDnD() ) { // Make a drop listener dropListener = new java.awt.dnd.DropTargetListener() - { public void dragEnter( java.awt.dnd.DropTargetDragEvent evt ) + { @Override public void dragEnter( java.awt.dnd.DropTargetDragEvent evt ) { log( out, "FileDrop: dragEnter event." ); // Is this an acceptable drag event? @@ -294,11 +294,13 @@ public FileDrop( } // end else: drag not ok } // end dragEnter - public void dragOver( java.awt.dnd.DropTargetDragEvent evt ) + @Override + public void dragOver( java.awt.dnd.DropTargetDragEvent evt ) { // This is called continually as long as the mouse is // over the drag target. } // end dragOver + @Override public void drop( java.awt.dnd.DropTargetDropEvent evt ) { log( out, "FileDrop: drop event." ); try @@ -357,7 +359,8 @@ public void drop( java.awt.dnd.DropTargetDropEvent evt ) } // end finally } // end drop - public void dragExit( java.awt.dnd.DropTargetEvent evt ) + @Override + public void dragExit( java.awt.dnd.DropTargetEvent evt ) { log( out, "FileDrop: dragExit event." ); // If it's a Swing component, reset its border if( c instanceof javax.swing.JComponent ) @@ -367,7 +370,8 @@ public void dragExit( java.awt.dnd.DropTargetEvent evt ) } // end if: JComponent } // end dragExit - public void dropActionChanged( java.awt.dnd.DropTargetDragEvent evt ) + @Override + public void dropActionChanged( java.awt.dnd.DropTargetDragEvent evt ) { log( out, "FileDrop: dropActionChanged event." ); // Is this an acceptable drag event? if( isDragOk( out, evt ) ) @@ -426,7 +430,7 @@ private void makeDropTarget( final java.io.PrintStream out, final java.awt.Compo // Listen for hierarchy changes and remove the drop target when the parent gets cleared out. c.addHierarchyListener( new java.awt.event.HierarchyListener() - { public void hierarchyChanged( java.awt.event.HierarchyEvent evt ) + { @Override public void hierarchyChanged( java.awt.event.HierarchyEvent evt ) { log( out, "FileDrop: Hierarchy changed." ); java.awt.Component parent = c.getParent(); if( parent == null ) @@ -554,7 +558,7 @@ public static void main( String[] args ) java.awt.BorderLayout.CENTER ); new FileDrop( System.out, text, /*dragBorder,*/ new FileDrop.Listener() - { public void filesDropped( java.io.File[] files ) + { @Override public void filesDropped( java.io.File[] files ) { for( int i = 0; i < files.length; i++ ) { try { text.append( files[i].getCanonicalPath() + "\n" ); diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/render/LayerRenderer.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/render/LayerRenderer.java index 030252d5ad..ee4a33b088 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/render/LayerRenderer.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/render/LayerRenderer.java @@ -46,6 +46,7 @@ public LayerRenderer(Layer layer, GeometryContainer geomCont, Viewport viewport) this.viewport = viewport; } + @Override public void render(Graphics2D g) { if (! layer.isEnabled()) return; @@ -137,6 +138,7 @@ private void renderGeom(Graphics2D g, Viewport viewport, Geometry geometry, Styl } } + @Override public void cancel() { isCancelled = true; diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/render/OperationMonitorManager.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/render/OperationMonitorManager.java index 120cfe6864..349dce9671 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/render/OperationMonitorManager.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/render/OperationMonitorManager.java @@ -42,6 +42,7 @@ public class OperationMonitorManager private Timer repaintTimer = new Timer(50, new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { if (indicator != null) { paint(); diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/render/RenderManager.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/render/RenderManager.java index f83e1c97f5..62213c43fe 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/render/RenderManager.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/render/RenderManager.java @@ -35,6 +35,7 @@ public class RenderManager private Timer repaintTimer = new Timer(100, new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { if (worker.isRendering()) { paintPanel(); @@ -137,6 +138,7 @@ public RendererSwingWorker(Renderer renderable, Image image) this.image = image; } + @Override public Object construct() { isRendering = true; diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/ArrowLineEndStyle.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/ArrowLineEndStyle.java index 36c090efc2..1f816ec28f 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/ArrowLineEndStyle.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/ArrowLineEndStyle.java @@ -44,6 +44,7 @@ public void setColor(Color color) { this.color = ColorUtil.setAlpha(color, FILL_ALPHA); } + @Override protected void paint(Point2D terminal, Point2D next, Viewport viewport, Graphics2D g) throws NoninvertibleTransformException { diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/ArrowSegmentStyle.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/ArrowSegmentStyle.java index 6838b0579b..4e06398dbf 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/ArrowSegmentStyle.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/ArrowSegmentStyle.java @@ -46,6 +46,7 @@ public void setColor(Color color) { this.color = color; } + @Override protected void paint(int index, Point2D p0, Point2D p1, int lineType, Viewport vp, Graphics2D gr) throws Exception { diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/BasicStyle.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/BasicStyle.java index 1082af7fec..00d5bb0062 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/BasicStyle.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/BasicStyle.java @@ -60,6 +60,7 @@ public BasicStyle copy() { return new BasicStyle(this); } + @Override public void paint(Geometry geom, Viewport viewport, Graphics2D g) { Stroke stroke = createStroke(); diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/CircleLineEndStyle.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/CircleLineEndStyle.java index b8a861598e..2f0c7e30e3 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/CircleLineEndStyle.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/CircleLineEndStyle.java @@ -60,6 +60,7 @@ public void setSize(double size) { this.diameter = size; } + @Override protected void paint(Point2D terminal, Point2D next, Viewport viewport, Graphics2D g) { diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/ComponentStyle.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/ComponentStyle.java index b0376bc751..b0eb9a3332 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/ComponentStyle.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/ComponentStyle.java @@ -22,7 +22,8 @@ public abstract class ComponentStyle implements Style { - public void paint(Geometry geom, Viewport viewport, Graphics2D g) + @Override + public void paint(Geometry geom, Viewport viewport, Graphics2D g) throws Exception { // cull non-visible geometries diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/DataLabelStyle.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/DataLabelStyle.java index 38c8eb8978..aa14a07b3a 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/DataLabelStyle.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/DataLabelStyle.java @@ -56,6 +56,7 @@ public void setSize(int size) { font = new Font(FontGlyphReader.FONT_SANSSERIF, Font.BOLD, size); } + @Override public void paint(Geometry geom, Viewport viewport, Graphics2D g2d) { if (geom.getUserData() == null) return; diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/LayerStyle.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/LayerStyle.java index 6afbb16bbb..c8e4172081 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/LayerStyle.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/LayerStyle.java @@ -223,6 +223,7 @@ public void setLabelColor(Color color) { labelStyle.setColor(color); } + @Override public void paint(Geometry geom, Viewport viewport, Graphics2D g) throws Exception { Geometry transformGeom = transform(geom, viewport); geomStyle.paint(transformGeom, viewport, g); diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/LineEndStyle.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/LineEndStyle.java index 8cc1f53eae..9545442b62 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/LineEndStyle.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/LineEndStyle.java @@ -27,6 +27,7 @@ public LineEndStyle(boolean start) { this.start = start; } + @Override protected void paintLineString(LineString lineString, int lineType, Viewport viewport, Graphics2D graphics ) throws Exception { if (lineString.isEmpty()) { diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/LineStringStyle.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/LineStringStyle.java index f1925f87c7..c8f8248cff 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/LineStringStyle.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/LineStringStyle.java @@ -33,7 +33,8 @@ public abstract class LineStringStyle public LineStringStyle() { } - public void paint(Geometry geom, Viewport viewport, Graphics2D g) + @Override + public void paint(Geometry geom, Viewport viewport, Graphics2D g) throws Exception { // cull non-visible geometries diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/MidArrowLineStyle.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/MidArrowLineStyle.java index e05f8c93b9..0654d660ab 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/MidArrowLineStyle.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/MidArrowLineStyle.java @@ -33,6 +33,7 @@ public MidArrowLineStyle(Color color) { this.color = color; } + @Override protected void paint(int index, Point2D p0, Point2D p1, int lineType, Viewport vp, Graphics2D gr) throws Exception { diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/PolygonStructureStyle.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/PolygonStructureStyle.java index 9cac0fdae3..4ac4d14650 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/PolygonStructureStyle.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/PolygonStructureStyle.java @@ -39,6 +39,7 @@ public PolygonStructureStyle(Color color) { this.color = color; } + @Override protected void paintLineString(LineString lineString, int lineType, Viewport viewport, Graphics2D gr) diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/SegmentIndexStyle.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/SegmentIndexStyle.java index 9a9c23ff55..ad6373a71b 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/SegmentIndexStyle.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/SegmentIndexStyle.java @@ -42,6 +42,7 @@ public SegmentIndexStyle(Color color) { this.color = color; } + @Override protected void paint(int index, Point2D p0, Point2D p1, int lineType, Viewport vp, Graphics2D gr) throws Exception { diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/SegmentStyle.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/SegmentStyle.java index 55a6c86951..1c68d84372 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/SegmentStyle.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/SegmentStyle.java @@ -29,6 +29,7 @@ public SegmentStyle() { super(); } + @Override protected void paintLineString(LineString lineString, int lineType, Viewport viewport, Graphics2D graphics) throws Exception { for (int i = 0; i < lineString.getNumPoints() - 1; i++) { paint(i, diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/StyleList.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/StyleList.java index d15dee2d05..02e4b01cc1 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/StyleList.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/StyleList.java @@ -32,6 +32,7 @@ public class StyleList implements Style { private List styleList = new ArrayList(); + @Override public void paint(Geometry geom, Viewport viewport, Graphics2D g) throws Exception { diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/TintBandStyle.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/TintBandStyle.java index 406abd374a..c81d490362 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/TintBandStyle.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/TintBandStyle.java @@ -39,6 +39,7 @@ public class TintBandStyle implements Style public TintBandStyle() { } + @Override public void paint(Geometry geom, Viewport viewport, Graphics2D g2d) { if (! (geom instanceof Polygon)) diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/VertexLabelStyle.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/VertexLabelStyle.java index ab4cc35b68..0faf4d0ddb 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/VertexLabelStyle.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/VertexLabelStyle.java @@ -67,6 +67,7 @@ public void setSize(int size) { private void init() { } + @Override public void paint(Geometry geom, Viewport viewport, Graphics2D g) { g.setPaint(color); diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/VertexStyle.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/VertexStyle.java index 005961e84a..1e94e83a85 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/VertexStyle.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/style/VertexStyle.java @@ -79,6 +79,7 @@ private void init() { stroke = new BasicStroke(strokeSize); } + @Override public void paint(Geometry geom, Viewport viewport, Graphics2D g) { g.setPaint(color); diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/AbstractDrawTool.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/AbstractDrawTool.java index 889d243648..7a08d314c0 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/AbstractDrawTool.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/AbstractDrawTool.java @@ -29,11 +29,13 @@ protected AbstractDrawTool() { protected abstract int getGeometryType(); + @Override public void mouseClicked(MouseEvent e) { setBandType(); super.mouseClicked(e); } + @Override protected void bandFinished() throws Exception { setType(); geomModel().addComponent(getCoordinates()); diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/AbstractStreamDrawTool.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/AbstractStreamDrawTool.java index 6d8ea3c52f..5cf6be5a6c 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/AbstractStreamDrawTool.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/AbstractStreamDrawTool.java @@ -30,6 +30,7 @@ protected AbstractStreamDrawTool() { protected abstract int getGeometryType(); + @Override protected void mouseLocationChanged(MouseEvent e) { try { if ((e.getModifiersEx() & InputEvent.BUTTON1_DOWN_MASK) @@ -47,17 +48,20 @@ protected void mouseLocationChanged(MouseEvent e) { } } + @Override public void mousePressed(MouseEvent e) { setBandType(); super.mousePressed(e); } + @Override public void mouseClicked(MouseEvent e) { setBandType(); super.mouseClicked(e); } + @Override protected void bandFinished() throws Exception { setType(); geomModel().addComponent(getCoordinates()); diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/BasicTool.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/BasicTool.java index f74a6e4445..afc8ef485a 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/BasicTool.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/BasicTool.java @@ -56,18 +56,30 @@ protected Graphics2D getGraphics2D() { return g; } + @Override public void mouseClicked(MouseEvent e) {} + @Override public void mousePressed(MouseEvent e) {} + @Override public void mouseReleased(MouseEvent e) {} + @Override public void mouseEntered(MouseEvent e) {} + @Override public void mouseExited(MouseEvent e) {} + @Override public void mouseDragged(MouseEvent e) { } + @Override public void keyPressed(KeyEvent e) { } + @Override public void keyReleased(KeyEvent e) { } + @Override public void keyTyped(KeyEvent e) { } + @Override public void mouseMoved(MouseEvent e) { } + @Override public void mouseWheelMoved(MouseWheelEvent e) { } + @Override public Cursor getCursor() { return cursor; @@ -78,7 +90,8 @@ public Cursor getCursor() * * If subclasses override this method they must call super.activate(). */ - public void activate(GeometryEditPanel panel) + @Override + public void activate(GeometryEditPanel panel) { this.panel = panel; gridPM = getViewport().getGridPrecisionModel(); @@ -88,7 +101,8 @@ public void activate(GeometryEditPanel panel) this.panel.addMouseWheelListener(this); } - public void deactivate() + @Override + public void deactivate() { this.panel.removeMouseListener(this); this.panel.removeMouseMotionListener(this); diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/BoxBandTool.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/BoxBandTool.java index c7077545b6..46d8157c4f 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/BoxBandTool.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/BoxBandTool.java @@ -45,6 +45,7 @@ public BoxBandTool(Cursor cursor) { super(cursor); } + @Override public void mousePressed(MouseEvent e) { zoomBoxStart = e.getPoint(); @@ -53,6 +54,7 @@ public void mousePressed(MouseEvent e) isRightButton = SwingUtilities.isRightMouseButton(e); } + @Override public void mouseReleased(MouseEvent e) { clearIndicator(); @@ -64,6 +66,7 @@ public void mouseReleased(MouseEvent e) gestureFinished(); } + @Override public void mouseDragged(MouseEvent e) { super.mouseDragged(e); @@ -71,6 +74,7 @@ public void mouseDragged(MouseEvent e) redrawIndicator(); } + @Override protected Shape getShape() { if (zoomBoxEnd == null) return null; diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/DeleteByBoxTool.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/DeleteByBoxTool.java index c87dc030af..3103212b5f 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/DeleteByBoxTool.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/DeleteByBoxTool.java @@ -33,7 +33,8 @@ private DeleteByBoxTool() { super(); } - protected void gestureFinished() + @Override + protected void gestureFinished() { Envelope env = getBox().getEnvelopeInternal(); Geometry g = geomModel().getGeometry(); diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/EditVertexTool.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/EditVertexTool.java index 1037bb2b56..9c3e6cc0ae 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/EditVertexTool.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/EditVertexTool.java @@ -48,6 +48,7 @@ private EditVertexTool() { super(AppCursors.EDIT_VERTEX); } + @Override public void mousePressed(MouseEvent e) { currentVertexLoc = null; if (SwingUtilities.isRightMouseButton(e)) @@ -65,6 +66,7 @@ public void mousePressed(MouseEvent e) { } } + @Override public void mouseReleased(MouseEvent e) { if (SwingUtilities.isRightMouseButton(e)) return; @@ -77,12 +79,14 @@ public void mouseReleased(MouseEvent e) { } } + @Override public void mouseDragged(MouseEvent e) { currentVertexLoc = toModelSnapped(e.getPoint()); if (selectedVertexLocation != null) redrawIndicator(); } + @Override public void mouseClicked(MouseEvent e) { if (! SwingUtilities.isRightMouseButton(e)) return; @@ -107,7 +111,8 @@ public void mouseClicked(MouseEvent e) { } } - protected Shape getShape() + @Override + protected Shape getShape() { GeometryCollectionShape ind = new GeometryCollectionShape(); Point2D currentIndicatorLoc = toView(currentVertexLoc); diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/ExtractComponentTool.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/ExtractComponentTool.java index 3323718f52..961fdc58b1 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/ExtractComponentTool.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/ExtractComponentTool.java @@ -32,7 +32,8 @@ private ExtractComponentTool() { super(Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR)); } - protected void gestureFinished() + @Override + protected void gestureFinished() { boolean isSegments = isControlKeyDown(); JTSTestBuilder.controller().extractComponentsToTestCase(getBox(), isSegments); diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/IndicatorTool.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/IndicatorTool.java index 00e5a260a1..0c8bbe8f69 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/IndicatorTool.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/IndicatorTool.java @@ -160,11 +160,13 @@ private String getLabel() // protected void gestureFinished() throws Exception; - public void mouseDragged(MouseEvent e) + @Override + public void mouseDragged(MouseEvent e) { recordLabel(e.getPoint()); } + @Override public void mouseMoved(MouseEvent e) { recordLabel(e.getPoint()); } diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/InfoTool.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/InfoTool.java index 356cbb2737..b62b099e20 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/InfoTool.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/InfoTool.java @@ -31,7 +31,8 @@ public static InfoTool getInstance() { private InfoTool() { } - public void mousePressed(MouseEvent e) + @Override + public void mousePressed(MouseEvent e) { JTSTestBuilder.controller().displayInfo(toModelCoordinate(e.getPoint())); } diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/LineBandTool.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/LineBandTool.java index 82294c3c5d..b17be9ee33 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/LineBandTool.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/LineBandTool.java @@ -70,6 +70,7 @@ public Coordinate lastCoordinate() return (Coordinate) coordinates.get(coordinates.size()-1); } + @Override public void mouseReleased(MouseEvent e) { try { // Can't assert that coordinates is not empty at this point @@ -134,11 +135,13 @@ protected void mouseLocationChanged(MouseEvent e) { } } + @Override public void mouseMoved(MouseEvent e) { super.mouseMoved(e); mouseLocationChanged(e); } + @Override public void mouseDragged(MouseEvent e) { super.mouseDragged(e); mouseLocationChanged(e); @@ -151,6 +154,7 @@ protected void add(Coordinate c) { coordinates.add(c); } + @Override public void mousePressed(MouseEvent e) { try { super.mousePressed(e); @@ -170,6 +174,7 @@ public void mousePressed(MouseEvent e) { } } + @Override protected Shape getShape() { if (coordinates.isEmpty()) { return null; diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/LineStringTool.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/LineStringTool.java index 5a0d8c4659..b5bfa0a19e 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/LineStringTool.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/LineStringTool.java @@ -31,6 +31,7 @@ private LineStringTool() { } + @Override protected int getGeometryType() { return GeometryType.LINESTRING; diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/MoveTool.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/MoveTool.java index 838ba77c6a..6208c7ce69 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/MoveTool.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/MoveTool.java @@ -57,6 +57,7 @@ private Geometry getComponent(Coordinate pt, double tolerance) { return geoms.get(0).getComponent(); } + @Override public void mousePressed(MouseEvent e) { startIndicatorLoc = null; //TODO: only start move if cursor is over geometry @@ -78,6 +79,7 @@ public void mousePressed(MouseEvent e) { redrawIndicator(); } + @Override public void mouseReleased(MouseEvent e) { clearIndicator(); // execute the move @@ -103,13 +105,15 @@ private void execute(Coordinate fromLoc, Coordinate toLoc, boolean isComponentMo geomModel().setGeometry(geomTrans); } + @Override public void mouseDragged(MouseEvent e) { currentVertexLoc = toModelSnapped(e.getPoint()); if (startIndicatorLoc != null) redrawIndicator(); } - protected Shape getShape() + @Override + protected Shape getShape() { Point2D currentIndicatorLoc = toView(currentVertexLoc); GeneralPath line = new GeneralPath(); diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/PanTool.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/PanTool.java index 2babd52786..230a55e65b 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/PanTool.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/PanTool.java @@ -36,6 +36,7 @@ public static PanTool getInstance() { private PanTool() { } + @Override public Cursor getCursor() { return AppCursors.HAND; } @@ -44,10 +45,12 @@ public void activate() { source = null; } + @Override public void mousePressed(MouseEvent e) { source = toModel(e.getPoint()); } + @Override public void mouseReleased(MouseEvent e) { if (source == null) return; diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/PointTool.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/PointTool.java index 1f6d50b1a1..71de99fa2b 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/PointTool.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/PointTool.java @@ -33,6 +33,7 @@ private PointTool() setDrawBandLines(false); } + @Override protected int getGeometryType() { return GeometryType.POINT; diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/PolygonTool.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/PolygonTool.java index acbcd2509c..5cca666db0 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/PolygonTool.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/PolygonTool.java @@ -31,6 +31,7 @@ private PolygonTool() { } + @Override protected int getGeometryType() { return GeometryType.POLYGON; diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/RectangleTool.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/RectangleTool.java index 8f28898107..1dc7136942 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/RectangleTool.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/RectangleTool.java @@ -32,7 +32,8 @@ public RectangleTool() { super(Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR)); } - protected void gestureFinished() + @Override + protected void gestureFinished() { geomModel().setGeometryType(GeometryType.POLYGON); geomModel().addComponent(getCoordinates()); diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/StreamPolygonTool.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/StreamPolygonTool.java index bac85b187a..110fbad895 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/StreamPolygonTool.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/StreamPolygonTool.java @@ -32,6 +32,7 @@ private StreamPolygonTool() super(); } + @Override protected int getGeometryType() { return GeometryType.POLYGON; diff --git a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/ZoomTool.java b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/ZoomTool.java index e1c8748ae1..e2e975b2d6 100644 --- a/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/ZoomTool.java +++ b/modules/app/src/main/java/org/locationtech/jtstest/testbuilder/ui/tools/ZoomTool.java @@ -47,7 +47,8 @@ public ZoomTool(double zoomFactor, Cursor cursor) { this.zoomFactor = zoomFactor; } - public void mouseClicked(MouseEvent mouseEvent) + @Override + public void mouseClicked(MouseEvent mouseEvent) { // determine if zoom in (left) or zoom out (right) double realZoomFactor = SwingUtilities.isRightMouseButton(mouseEvent) @@ -55,6 +56,7 @@ public void mouseClicked(MouseEvent mouseEvent) panel().zoom(toModel(mouseEvent.getPoint()), realZoomFactor); } + @Override public void mousePressed(MouseEvent e) { mouseStart = e.getPoint(); @@ -62,6 +64,7 @@ public void mousePressed(MouseEvent e) panStart = isPanGesture(e) ? toModel(mouseStart) : null; } + @Override public void mouseReleased(MouseEvent e) { // don't process if mouse was dragged a very short distance if (! isSignificantMouseMove(e.getPoint())) @@ -83,6 +86,7 @@ private boolean isPanning() { return panStart != null; } + @Override public void mouseDragged(MouseEvent e) { Graphics g = getBandGraphics(); @@ -111,6 +115,7 @@ private void drawBand(Graphics g) { } } + @Override public void mouseWheelMoved(MouseWheelEvent e) { /** * Rolling wheel forward zooms in, backward zooms out diff --git a/modules/core/src/main/java/org/locationtech/jts/algorithm/BoundaryNodeRule.java b/modules/core/src/main/java/org/locationtech/jts/algorithm/BoundaryNodeRule.java index 7770f6273a..ece0ecce4d 100644 --- a/modules/core/src/main/java/org/locationtech/jts/algorithm/BoundaryNodeRule.java +++ b/modules/core/src/main/java/org/locationtech/jts/algorithm/BoundaryNodeRule.java @@ -116,6 +116,7 @@ public interface BoundaryNodeRule public static class Mod2BoundaryNodeRule implements BoundaryNodeRule { + @Override public boolean isInBoundary(int boundaryCount) { // the "Mod-2 Rule" @@ -148,6 +149,7 @@ public boolean isInBoundary(int boundaryCount) public static class EndPointBoundaryNodeRule implements BoundaryNodeRule { + @Override public boolean isInBoundary(int boundaryCount) { return boundaryCount > 0; @@ -167,6 +169,7 @@ public boolean isInBoundary(int boundaryCount) public static class MultiValentEndPointBoundaryNodeRule implements BoundaryNodeRule { + @Override public boolean isInBoundary(int boundaryCount) { return boundaryCount > 1; @@ -185,6 +188,7 @@ public boolean isInBoundary(int boundaryCount) public static class MonoValentEndPointBoundaryNodeRule implements BoundaryNodeRule { + @Override public boolean isInBoundary(int boundaryCount) { return boundaryCount == 1; diff --git a/modules/core/src/main/java/org/locationtech/jts/algorithm/InteriorPoint.java b/modules/core/src/main/java/org/locationtech/jts/algorithm/InteriorPoint.java index 47b411c26b..2469e55adb 100644 --- a/modules/core/src/main/java/org/locationtech/jts/algorithm/InteriorPoint.java +++ b/modules/core/src/main/java/org/locationtech/jts/algorithm/InteriorPoint.java @@ -91,6 +91,7 @@ public int getDimension() { return dim; } + @Override public void filter(Geometry elem) { if (elem instanceof GeometryCollection) return; diff --git a/modules/core/src/main/java/org/locationtech/jts/algorithm/RobustLineIntersector.java b/modules/core/src/main/java/org/locationtech/jts/algorithm/RobustLineIntersector.java index 21a5891773..233290379d 100644 --- a/modules/core/src/main/java/org/locationtech/jts/algorithm/RobustLineIntersector.java +++ b/modules/core/src/main/java/org/locationtech/jts/algorithm/RobustLineIntersector.java @@ -29,6 +29,7 @@ public class RobustLineIntersector public RobustLineIntersector() { } + @Override public void computeIntersection(Coordinate p, Coordinate p1, Coordinate p2) { isProper = false; // do between check first, since it is faster than the orientation test @@ -46,6 +47,7 @@ public void computeIntersection(Coordinate p, Coordinate p1, Coordinate p2) { result = NO_INTERSECTION; } + @Override protected int computeIntersect( Coordinate p1, Coordinate p2, Coordinate q1, Coordinate q2 ) { diff --git a/modules/core/src/main/java/org/locationtech/jts/algorithm/construct/LargestEmptyCircle.java b/modules/core/src/main/java/org/locationtech/jts/algorithm/construct/LargestEmptyCircle.java index ede804f0f7..b46f91bac8 100644 --- a/modules/core/src/main/java/org/locationtech/jts/algorithm/construct/LargestEmptyCircle.java +++ b/modules/core/src/main/java/org/locationtech/jts/algorithm/construct/LargestEmptyCircle.java @@ -451,6 +451,7 @@ public double getY() { * For maximum efficieny sort the PriorityQueue with largest maxDistance at front. * Since Java PQ sorts least-first, need to invert the comparison */ + @Override public int compareTo(Cell o) { return -Double.compare(maxDist, o.maxDist); } diff --git a/modules/core/src/main/java/org/locationtech/jts/algorithm/construct/MaximumInscribedCircle.java b/modules/core/src/main/java/org/locationtech/jts/algorithm/construct/MaximumInscribedCircle.java index 52cff69fb4..336673ff98 100644 --- a/modules/core/src/main/java/org/locationtech/jts/algorithm/construct/MaximumInscribedCircle.java +++ b/modules/core/src/main/java/org/locationtech/jts/algorithm/construct/MaximumInscribedCircle.java @@ -361,6 +361,7 @@ public double getY() { * For maximum efficieny sort the PriorityQueue with largest maxDistance at front. * Since Java PQ sorts least-first, need to invert the comparison */ + @Override public int compareTo(Cell o) { return -Double.compare(maxDist, o.maxDist); } diff --git a/modules/core/src/main/java/org/locationtech/jts/algorithm/distance/DiscreteFrechetDistance.java b/modules/core/src/main/java/org/locationtech/jts/algorithm/distance/DiscreteFrechetDistance.java index a12948950a..67ff5c2f21 100644 --- a/modules/core/src/main/java/org/locationtech/jts/algorithm/distance/DiscreteFrechetDistance.java +++ b/modules/core/src/main/java/org/locationtech/jts/algorithm/distance/DiscreteFrechetDistance.java @@ -415,12 +415,15 @@ public RectMatrix(int numRows, int numCols, double defaultValue) Arrays.fill(this.matrix, defaultValue); } + @Override public double get(int i, int j) { return this.matrix[i * numCols + j]; } + @Override public void set(int i, int j, double value) { this.matrix[i * numCols + j] = value; } + @Override public boolean isValueSet(int i, int j) { return Double.doubleToLongBits(get(i, j)) != Double.doubleToLongBits(this.defaultValue); } @@ -550,16 +553,19 @@ public HashMapMatrix(int numRows, int numCols, double defaultValue) { this.matrix = new HashMap<>(); } + @Override public double get(int i, int j) { long key = (long)i << 32 | j; return matrix.getOrDefault(key, this.defaultValue); } + @Override public void set(int i, int j, double value) { long key = (long)i << 32 | j; matrix.put(key, value); } + @Override public boolean isValueSet(int i, int j) { long key = (long)i << 32 | j; return matrix.containsKey(key); diff --git a/modules/core/src/main/java/org/locationtech/jts/algorithm/distance/DiscreteHausdorffDistance.java b/modules/core/src/main/java/org/locationtech/jts/algorithm/distance/DiscreteHausdorffDistance.java index b1512d4449..ffb6011420 100644 --- a/modules/core/src/main/java/org/locationtech/jts/algorithm/distance/DiscreteHausdorffDistance.java +++ b/modules/core/src/main/java/org/locationtech/jts/algorithm/distance/DiscreteHausdorffDistance.java @@ -148,6 +148,7 @@ public MaxPointDistanceFilter(Geometry geom) this.geom = geom; } + @Override public void filter(Coordinate pt) { minPtDist.initialize(); @@ -171,7 +172,8 @@ public MaxDensifiedByFractionDistanceFilter(Geometry geom, double fraction) { numSubSegs = (int) Math.rint(1.0/fraction); } - public void filter(CoordinateSequence seq, int index) + @Override + public void filter(CoordinateSequence seq, int index) { /** * This logic also handles skipping Point geometries @@ -197,8 +199,10 @@ public void filter(CoordinateSequence seq, int index) } + @Override public boolean isGeometryChanged() { return false; } + @Override public boolean isDone() { return false; } public PointPairDistance getMaxPointDistance() { diff --git a/modules/core/src/main/java/org/locationtech/jts/algorithm/hull/HullTriangulation.java b/modules/core/src/main/java/org/locationtech/jts/algorithm/hull/HullTriangulation.java index 3a01f1b282..a812970be8 100644 --- a/modules/core/src/main/java/org/locationtech/jts/algorithm/hull/HullTriangulation.java +++ b/modules/core/src/main/java/org/locationtech/jts/algorithm/hull/HullTriangulation.java @@ -61,6 +61,7 @@ private static class HullTriVisitor implements TriangleVisitor { public HullTriVisitor() { } + @Override public void visit(QuadEdge[] triEdges) { Coordinate p0 = triEdges[0].orig().getCoordinate(); Coordinate p1 = triEdges[1].orig().getCoordinate(); diff --git a/modules/core/src/main/java/org/locationtech/jts/algorithm/locate/IndexedPointInAreaLocator.java b/modules/core/src/main/java/org/locationtech/jts/algorithm/locate/IndexedPointInAreaLocator.java index 031df59852..3a3a56893e 100644 --- a/modules/core/src/main/java/org/locationtech/jts/algorithm/locate/IndexedPointInAreaLocator.java +++ b/modules/core/src/main/java/org/locationtech/jts/algorithm/locate/IndexedPointInAreaLocator.java @@ -75,6 +75,7 @@ public IndexedPointInAreaLocator(Geometry g) * @param p the point to test * @return the location of the point in the geometry */ + @Override public int locate(Coordinate p) { // avoid calling synchronized method improves performance @@ -115,6 +116,7 @@ public SegmentVisitor(RayCrossingCounter counter) this.counter = counter; } + @Override public void visitItem(Object item) { LineSegment seg = (LineSegment) item; diff --git a/modules/core/src/main/java/org/locationtech/jts/algorithm/locate/SimplePointInAreaLocator.java b/modules/core/src/main/java/org/locationtech/jts/algorithm/locate/SimplePointInAreaLocator.java index 07e07f66c0..94d73b4080 100644 --- a/modules/core/src/main/java/org/locationtech/jts/algorithm/locate/SimplePointInAreaLocator.java +++ b/modules/core/src/main/java/org/locationtech/jts/algorithm/locate/SimplePointInAreaLocator.java @@ -198,6 +198,7 @@ public SimplePointInAreaLocator(Geometry geom) { * @param p the point to test * @return the Location of the point in the geometry */ + @Override public int locate(Coordinate p) { return SimplePointInAreaLocator.locate(p, geom); } diff --git a/modules/core/src/main/java/org/locationtech/jts/algorithm/match/AreaSimilarityMeasure.java b/modules/core/src/main/java/org/locationtech/jts/algorithm/match/AreaSimilarityMeasure.java index e6630e16b6..3b66173479 100644 --- a/modules/core/src/main/java/org/locationtech/jts/algorithm/match/AreaSimilarityMeasure.java +++ b/modules/core/src/main/java/org/locationtech/jts/algorithm/match/AreaSimilarityMeasure.java @@ -43,6 +43,7 @@ public AreaSimilarityMeasure() { } + @Override public double measure(Geometry g1, Geometry g2) { double areaInt = g1.intersection(g2).getArea(); diff --git a/modules/core/src/main/java/org/locationtech/jts/algorithm/match/HausdorffSimilarityMeasure.java b/modules/core/src/main/java/org/locationtech/jts/algorithm/match/HausdorffSimilarityMeasure.java index c841fc7389..44ae1468e3 100644 --- a/modules/core/src/main/java/org/locationtech/jts/algorithm/match/HausdorffSimilarityMeasure.java +++ b/modules/core/src/main/java/org/locationtech/jts/algorithm/match/HausdorffSimilarityMeasure.java @@ -50,6 +50,7 @@ public HausdorffSimilarityMeasure() */ private static final double DENSIFY_FRACTION = 0.25; + @Override public double measure(Geometry g1, Geometry g2) { double distance = DiscreteHausdorffDistance.distance(g1, g2, DENSIFY_FRACTION); diff --git a/modules/core/src/main/java/org/locationtech/jts/awt/GeometryCollectionShape.java b/modules/core/src/main/java/org/locationtech/jts/awt/GeometryCollectionShape.java index 9cbaf80753..398393f075 100644 --- a/modules/core/src/main/java/org/locationtech/jts/awt/GeometryCollectionShape.java +++ b/modules/core/src/main/java/org/locationtech/jts/awt/GeometryCollectionShape.java @@ -40,12 +40,14 @@ public void add(Shape shape) { shapes.add(shape); } + @Override public Rectangle getBounds() { /**@todo Implement this java.awt.Shape method*/ throw new java.lang.UnsupportedOperationException( "Method getBounds() not yet implemented."); } + @Override public Rectangle2D getBounds2D() { Rectangle2D rectangle = null; @@ -62,46 +64,54 @@ public Rectangle2D getBounds2D() { return rectangle; } + @Override public boolean contains(double x, double y) { /**@todo Implement this java.awt.Shape method*/ throw new java.lang.UnsupportedOperationException( "Method contains() not yet implemented."); } + @Override public boolean contains(Point2D p) { /**@todo Implement this java.awt.Shape method*/ throw new java.lang.UnsupportedOperationException( "Method contains() not yet implemented."); } + @Override public boolean intersects(double x, double y, double w, double h) { /**@todo Implement this java.awt.Shape method*/ throw new java.lang.UnsupportedOperationException( "Method intersects() not yet implemented."); } + @Override public boolean intersects(Rectangle2D r) { /**@todo Implement this java.awt.Shape method*/ throw new java.lang.UnsupportedOperationException( "Method intersects() not yet implemented."); } + @Override public boolean contains(double x, double y, double w, double h) { /**@todo Implement this java.awt.Shape method*/ throw new java.lang.UnsupportedOperationException( "Method contains() not yet implemented."); } + @Override public boolean contains(Rectangle2D r) { /**@todo Implement this java.awt.Shape method*/ throw new java.lang.UnsupportedOperationException( "Method contains() not yet implemented."); } + @Override public PathIterator getPathIterator(AffineTransform at) { return new ShapeCollectionPathIterator(shapes, at); } + @Override public PathIterator getPathIterator(AffineTransform at, double flatness) { // since Geometry is linear, can simply delegate to the simple method return getPathIterator(at); diff --git a/modules/core/src/main/java/org/locationtech/jts/awt/IdentityPointTransformation.java b/modules/core/src/main/java/org/locationtech/jts/awt/IdentityPointTransformation.java index b562e9106a..f4c349c381 100644 --- a/modules/core/src/main/java/org/locationtech/jts/awt/IdentityPointTransformation.java +++ b/modules/core/src/main/java/org/locationtech/jts/awt/IdentityPointTransformation.java @@ -24,6 +24,7 @@ public class IdentityPointTransformation implements PointTransformation { + @Override public void transform(Coordinate model, Point2D view) { view.setLocation(model.x, model.y); diff --git a/modules/core/src/main/java/org/locationtech/jts/awt/PointShapeFactory.java b/modules/core/src/main/java/org/locationtech/jts/awt/PointShapeFactory.java index 2900c87562..7658b1846d 100644 --- a/modules/core/src/main/java/org/locationtech/jts/awt/PointShapeFactory.java +++ b/modules/core/src/main/java/org/locationtech/jts/awt/PointShapeFactory.java @@ -70,6 +70,7 @@ public BasePointShapeFactory(double size) { * the location of the point * @return a shape */ + @Override public abstract Shape createPoint(Point2D point); } @@ -99,6 +100,7 @@ public Point(double size) { * the location of the point * @return a shape */ + @Override public Shape createPoint(Point2D point) { Line2D.Double pointMarker = new Line2D.Double( @@ -136,6 +138,7 @@ public Square(double size) { * the location of the point * @return a shape */ + @Override public Shape createPoint(Point2D point) { Rectangle2D.Double pointMarker = new Rectangle2D.Double( @@ -176,6 +179,7 @@ public Star(double size) { * the location of the point * @return a shape */ + @Override public Shape createPoint(Point2D point) { GeneralPath path = new GeneralPath(); path.moveTo((float) point.getX(), (float) (point.getY() - size/2)); @@ -219,6 +223,7 @@ public Triangle(double size) { * the location of the point * @return a shape */ + @Override public Shape createPoint(Point2D point) { GeneralPath path = new GeneralPath(); @@ -257,6 +262,7 @@ public Circle(double size) { * the location of the point * @return a shape */ + @Override public Shape createPoint(Point2D point) { Ellipse2D.Double pointMarker = new Ellipse2D.Double( @@ -297,6 +303,7 @@ public Cross(double size) { * the location of the point * @return a shape */ + @Override public Shape createPoint(Point2D point) { float x1 = (float) (point.getX() - size/2f); @@ -354,6 +361,7 @@ public X(double size) { * the location of the point * @return a shape */ + @Override public Shape createPoint(Point2D point) { GeneralPath path = new GeneralPath(); path.moveTo((float) (point.getX()), (float) (point.getY() - size * 1/8)); diff --git a/modules/core/src/main/java/org/locationtech/jts/awt/PolygonShape.java b/modules/core/src/main/java/org/locationtech/jts/awt/PolygonShape.java index 02defa32b0..5231bd2c0b 100644 --- a/modules/core/src/main/java/org/locationtech/jts/awt/PolygonShape.java +++ b/modules/core/src/main/java/org/locationtech/jts/awt/PolygonShape.java @@ -101,42 +101,52 @@ private GeneralPath toPath(Coordinate[] coordinates) { return path; } + @Override public Rectangle getBounds() { return polygonPath.getBounds(); } + @Override public Rectangle2D getBounds2D() { return polygonPath.getBounds2D(); } + @Override public boolean contains(double x, double y) { return polygonPath.contains(x, y); } + @Override public boolean contains(Point2D p) { return polygonPath.contains(p); } + @Override public boolean intersects(double x, double y, double w, double h) { return polygonPath.intersects(x, y, w, h); } + @Override public boolean intersects(Rectangle2D r) { return polygonPath.intersects(r); } + @Override public boolean contains(double x, double y, double w, double h) { return polygonPath.contains(x, y, w, h); } + @Override public boolean contains(Rectangle2D r) { return polygonPath.contains(r); } + @Override public PathIterator getPathIterator(AffineTransform at) { return polygonPath.getPathIterator(at); } + @Override public PathIterator getPathIterator(AffineTransform at, double flatness) { return polygonPath.getPathIterator(at, flatness); } diff --git a/modules/core/src/main/java/org/locationtech/jts/awt/ShapeCollectionPathIterator.java b/modules/core/src/main/java/org/locationtech/jts/awt/ShapeCollectionPathIterator.java index b9405e0a61..1f32597d47 100644 --- a/modules/core/src/main/java/org/locationtech/jts/awt/ShapeCollectionPathIterator.java +++ b/modules/core/src/main/java/org/locationtech/jts/awt/ShapeCollectionPathIterator.java @@ -27,21 +27,26 @@ public class ShapeCollectionPathIterator implements PathIterator { // initialize with a no-op iterator private PathIterator currentPathIterator = new PathIterator() { + @Override public int getWindingRule() { throw new UnsupportedOperationException(); } + @Override public boolean isDone() { return true; } + @Override public void next() { } + @Override public int currentSegment(float[] coords) { throw new UnsupportedOperationException(); } + @Override public int currentSegment(double[] coords) { throw new UnsupportedOperationException(); } @@ -63,6 +68,7 @@ public ShapeCollectionPathIterator(Collection shapes, next(); } + @Override public int getWindingRule() { /** * WIND_NON_ZERO is more accurate than WIND_EVEN_ODD, and can be comparable @@ -74,10 +80,12 @@ public int getWindingRule() { return PathIterator.WIND_EVEN_ODD; } + @Override public boolean isDone() { return done; } + @Override public void next() { currentPathIterator.next(); @@ -90,10 +98,12 @@ public void next() { } } + @Override public int currentSegment(float[] coords) { return currentPathIterator.currentSegment(coords); } + @Override public int currentSegment(double[] coords) { return currentPathIterator.currentSegment(coords); } diff --git a/modules/core/src/main/java/org/locationtech/jts/densify/Densifier.java b/modules/core/src/main/java/org/locationtech/jts/densify/Densifier.java index 47b91759cf..3bc9b9d2fb 100644 --- a/modules/core/src/main/java/org/locationtech/jts/densify/Densifier.java +++ b/modules/core/src/main/java/org/locationtech/jts/densify/Densifier.java @@ -155,6 +155,7 @@ static class DensifyTransformer extends GeometryTransformer { this.isValidated = isValidated; } + @Override protected CoordinateSequence transformCoordinates( CoordinateSequence coords, Geometry parent) { Coordinate[] inputPts = coords.toCoordinateArray(); @@ -167,6 +168,7 @@ protected CoordinateSequence transformCoordinates( return factory.getCoordinateSequenceFactory().create(newPts); } + @Override protected Geometry transformPolygon(Polygon geom, Geometry parent) { Geometry roughGeom = super.transformPolygon(geom, parent); // don't try and correct if the parent is going to do this @@ -176,6 +178,7 @@ protected Geometry transformPolygon(Polygon geom, Geometry parent) { return createValidArea(roughGeom); } + @Override protected Geometry transformMultiPolygon(MultiPolygon geom, Geometry parent) { Geometry roughGeom = super.transformMultiPolygon(geom, parent); return createValidArea(roughGeom); diff --git a/modules/core/src/main/java/org/locationtech/jts/dissolve/DissolveEdgeGraph.java b/modules/core/src/main/java/org/locationtech/jts/dissolve/DissolveEdgeGraph.java index aa7c1d7762..e921b1aff1 100644 --- a/modules/core/src/main/java/org/locationtech/jts/dissolve/DissolveEdgeGraph.java +++ b/modules/core/src/main/java/org/locationtech/jts/dissolve/DissolveEdgeGraph.java @@ -25,6 +25,7 @@ */ class DissolveEdgeGraph extends EdgeGraph { + @Override protected HalfEdge createEdge(Coordinate p0) { return new DissolveHalfEdge(p0); diff --git a/modules/core/src/main/java/org/locationtech/jts/dissolve/LineDissolver.java b/modules/core/src/main/java/org/locationtech/jts/dissolve/LineDissolver.java index d2ea4a2361..ff7662753a 100644 --- a/modules/core/src/main/java/org/locationtech/jts/dissolve/LineDissolver.java +++ b/modules/core/src/main/java/org/locationtech/jts/dissolve/LineDissolver.java @@ -88,6 +88,7 @@ public LineDissolver() */ public void add(Geometry geometry) { geometry.apply(new GeometryComponentFilter() { + @Override public void filter(Geometry component) { if (component instanceof LineString) { add((LineString)component); diff --git a/modules/core/src/main/java/org/locationtech/jts/edgegraph/EdgeGraphBuilder.java b/modules/core/src/main/java/org/locationtech/jts/edgegraph/EdgeGraphBuilder.java index 909c3cc2ac..1699ad3c17 100644 --- a/modules/core/src/main/java/org/locationtech/jts/edgegraph/EdgeGraphBuilder.java +++ b/modules/core/src/main/java/org/locationtech/jts/edgegraph/EdgeGraphBuilder.java @@ -57,6 +57,7 @@ public EdgeGraph getGraph() */ public void add(Geometry geometry) { geometry.apply(new GeometryComponentFilter() { + @Override public void filter(Geometry component) { if (component instanceof LineString) { add((LineString)component); diff --git a/modules/core/src/main/java/org/locationtech/jts/geom/Coordinate.java b/modules/core/src/main/java/org/locationtech/jts/geom/Coordinate.java index fbdda635a0..938ac90369 100644 --- a/modules/core/src/main/java/org/locationtech/jts/geom/Coordinate.java +++ b/modules/core/src/main/java/org/locationtech/jts/geom/Coordinate.java @@ -375,6 +375,7 @@ public boolean equals(Object other) { *@return -1, zero, or 1 as this Coordinate * is less than, equal to, or greater than the specified Coordinate */ + @Override public int compareTo(Coordinate o) { Coordinate other = (Coordinate) o; @@ -394,6 +395,7 @@ public String toString() { return "(" + x + ", " + y + ", " + getZ() + ")"; } + @Override public Object clone() { try { Coordinate coord = (Coordinate) super.clone(); @@ -539,6 +541,7 @@ public DimensionalComparator(int dimensionsToTest) * equal to, or greater than 02 * */ + @Override public int compare(Coordinate c1, Coordinate c2) { int compX = compare(c1.x, c2.x); diff --git a/modules/core/src/main/java/org/locationtech/jts/geom/CoordinateArrays.java b/modules/core/src/main/java/org/locationtech/jts/geom/CoordinateArrays.java index 1b499d8571..aa006a45c0 100644 --- a/modules/core/src/main/java/org/locationtech/jts/geom/CoordinateArrays.java +++ b/modules/core/src/main/java/org/locationtech/jts/geom/CoordinateArrays.java @@ -223,6 +223,7 @@ public static int compare(Coordinate[] pts1, Coordinate[] pts2) { */ public static class ForwardComparator implements Comparator { + @Override public int compare(Object o1, Object o2) { Coordinate[] pts1 = (Coordinate[]) o1; Coordinate[] pts2 = (Coordinate[]) o2; @@ -286,6 +287,7 @@ private static boolean isEqualReversed(Coordinate[] pts1, Coordinate[] pts2) { */ public static class BidirectionalComparator implements Comparator { + @Override public int compare(Object o1, Object o2) { Coordinate[] pts1 = (Coordinate[]) o1; Coordinate[] pts2 = (Coordinate[]) o2; diff --git a/modules/core/src/main/java/org/locationtech/jts/geom/CoordinateList.java b/modules/core/src/main/java/org/locationtech/jts/geom/CoordinateList.java index 4c7e5997a8..41e14261ae 100644 --- a/modules/core/src/main/java/org/locationtech/jts/geom/CoordinateList.java +++ b/modules/core/src/main/java/org/locationtech/jts/geom/CoordinateList.java @@ -237,6 +237,7 @@ public Coordinate[] toCoordinateArray(boolean isForward) * * @return a clone of this CoordinateList instance */ + @Override public Object clone() { CoordinateList clone = (CoordinateList) super.clone(); for (int i = 0; i < this.size(); i++) { diff --git a/modules/core/src/main/java/org/locationtech/jts/geom/CoordinateSequenceComparator.java b/modules/core/src/main/java/org/locationtech/jts/geom/CoordinateSequenceComparator.java index 7205bc684a..106950f3dd 100644 --- a/modules/core/src/main/java/org/locationtech/jts/geom/CoordinateSequenceComparator.java +++ b/modules/core/src/main/java/org/locationtech/jts/geom/CoordinateSequenceComparator.java @@ -80,6 +80,7 @@ public CoordinateSequenceComparator(int dimensionLimit) * @param o2 a {@link CoordinateSequence} * @return -1, 0, or 1 depending on whether o1 is less than, equal to, or greater than o2 */ + @Override public int compare(Object o1, Object o2) { CoordinateSequence s1 = (CoordinateSequence) o1; diff --git a/modules/core/src/main/java/org/locationtech/jts/geom/CoordinateXY.java b/modules/core/src/main/java/org/locationtech/jts/geom/CoordinateXY.java index 217d3822ff..cd1e91026b 100644 --- a/modules/core/src/main/java/org/locationtech/jts/geom/CoordinateXY.java +++ b/modules/core/src/main/java/org/locationtech/jts/geom/CoordinateXY.java @@ -73,6 +73,7 @@ public CoordinateXY(CoordinateXY coord) { * * @return a copy of this CoordinateXY */ + @Override public CoordinateXY copy() { return new CoordinateXY(this); } diff --git a/modules/core/src/main/java/org/locationtech/jts/geom/CoordinateXYM.java b/modules/core/src/main/java/org/locationtech/jts/geom/CoordinateXYM.java index eda6c4bc47..ecf6e7c4ae 100644 --- a/modules/core/src/main/java/org/locationtech/jts/geom/CoordinateXYM.java +++ b/modules/core/src/main/java/org/locationtech/jts/geom/CoordinateXYM.java @@ -83,6 +83,7 @@ public CoordinateXYM(CoordinateXYM coord) { * * @return a copy of this CoordinateXYM */ + @Override public CoordinateXYM copy() { return new CoordinateXYM(this); } @@ -101,10 +102,12 @@ public Coordinate create() { protected double m; /** The m-measure, if available. */ + @Override public double getM() { return m; } + @Override public void setM(double m) { this.m = m; } diff --git a/modules/core/src/main/java/org/locationtech/jts/geom/CoordinateXYZM.java b/modules/core/src/main/java/org/locationtech/jts/geom/CoordinateXYZM.java index fe60958425..82340089ac 100644 --- a/modules/core/src/main/java/org/locationtech/jts/geom/CoordinateXYZM.java +++ b/modules/core/src/main/java/org/locationtech/jts/geom/CoordinateXYZM.java @@ -65,6 +65,7 @@ public CoordinateXYZM(CoordinateXYZM coord) { * * @return a copy of this CoordinateXYZM */ + @Override public CoordinateXYZM copy() { return new CoordinateXYZM(this); } @@ -83,14 +84,17 @@ public Coordinate create() { private double m; /** The m-measure, if available. */ + @Override public double getM() { return m; } + @Override public void setM(double m) { this.m = m; } + @Override public double getOrdinate(int ordinateIndex) { switch (ordinateIndex) { diff --git a/modules/core/src/main/java/org/locationtech/jts/geom/Envelope.java b/modules/core/src/main/java/org/locationtech/jts/geom/Envelope.java index a784bcfe14..d9b148525e 100644 --- a/modules/core/src/main/java/org/locationtech/jts/geom/Envelope.java +++ b/modules/core/src/main/java/org/locationtech/jts/geom/Envelope.java @@ -810,6 +810,7 @@ public String toString() * * @param o an Envelope object */ + @Override public int compareTo(Object o) { Envelope env = (Envelope) o; // compare nulls if present diff --git a/modules/core/src/main/java/org/locationtech/jts/geom/Geometry.java b/modules/core/src/main/java/org/locationtech/jts/geom/Geometry.java index ba0d353fb2..2cd75facc0 100644 --- a/modules/core/src/main/java/org/locationtech/jts/geom/Geometry.java +++ b/modules/core/src/main/java/org/locationtech/jts/geom/Geometry.java @@ -172,6 +172,7 @@ public abstract class Geometry public static final String TYPENAME_GEOMETRYCOLLECTION = "GeometryCollection"; private final static GeometryComponentFilter geometryChangedFilter = new GeometryComponentFilter() { + @Override public void filter(Geometry geom) { geom.geometryChangedAction(); } @@ -1596,6 +1597,7 @@ public boolean equalsNorm(Geometry g) * @return a clone of this instance * @deprecated */ + @Override public Object clone() { try { Geometry clone = (Geometry) super.clone(); @@ -1692,6 +1694,7 @@ public Geometry norm() * defined in "Normal Form For Geometry" in the JTS Technical * Specifications */ + @Override public int compareTo(Object o) { Geometry other = (Geometry) o; if (getTypeCode() != other.getTypeCode()) { diff --git a/modules/core/src/main/java/org/locationtech/jts/geom/GeometryCollection.java b/modules/core/src/main/java/org/locationtech/jts/geom/GeometryCollection.java index 06b0a4a6f9..581cf79c29 100644 --- a/modules/core/src/main/java/org/locationtech/jts/geom/GeometryCollection.java +++ b/modules/core/src/main/java/org/locationtech/jts/geom/GeometryCollection.java @@ -56,6 +56,7 @@ public GeometryCollection(Geometry[] geometries, GeometryFactory factory) { this.geometries = geometries; } + @Override public Coordinate getCoordinate() { for (int i = 0; i < geometries.length; i++) { if (! geometries[i].isEmpty()) { @@ -74,6 +75,7 @@ public Coordinate getCoordinate() { * * @return the collected coordinates * */ + @Override public Coordinate[] getCoordinates() { Coordinate[] coordinates = new Coordinate[getNumPoints()]; int k = -1; @@ -87,6 +89,7 @@ public Coordinate[] getCoordinates() { return coordinates; } + @Override public boolean isEmpty() { for (int i = 0; i < geometries.length; i++) { if (!geometries[i].isEmpty()) { @@ -96,6 +99,7 @@ public boolean isEmpty() { return true; } + @Override public int getDimension() { int dimension = Dimension.FALSE; for (int i = 0; i < geometries.length; i++) { @@ -104,6 +108,7 @@ public int getDimension() { return dimension; } + @Override public boolean hasDimension(int dim) { for (int i = 0; i < geometries.length; i++) { if (geometries[i].hasDimension(dim)) @@ -112,6 +117,7 @@ public boolean hasDimension(int dim) { return false; } + @Override public int getBoundaryDimension() { int dimension = Dimension.FALSE; for (int i = 0; i < geometries.length; i++) { @@ -120,14 +126,17 @@ public int getBoundaryDimension() { return dimension; } + @Override public int getNumGeometries() { return geometries.length; } + @Override public Geometry getGeometryN(int n) { return geometries[n]; } + @Override public int getNumPoints() { int numPoints = 0; for (int i = 0; i < geometries.length; i++) { @@ -136,10 +145,12 @@ public int getNumPoints() { return numPoints; } + @Override public String getGeometryType() { return Geometry.TYPENAME_GEOMETRYCOLLECTION; } + @Override public Geometry getBoundary() { checkNotGeometryCollection(this); Assert.shouldNeverReachHere(); @@ -151,6 +162,7 @@ public Geometry getBoundary() { * * @return the area of the polygon */ + @Override public double getArea() { double area = 0.0; @@ -160,6 +172,7 @@ public double getArea() return area; } + @Override public double getLength() { double sum = 0.0; @@ -169,6 +182,7 @@ public double getLength() return sum; } + @Override public boolean equalsExact(Geometry other, double tolerance) { if (!isEquivalentClass(other)) { return false; @@ -185,12 +199,14 @@ public boolean equalsExact(Geometry other, double tolerance) { return true; } + @Override public void apply(CoordinateFilter filter) { for (int i = 0; i < geometries.length; i++) { geometries[i].apply(filter); } } + @Override public void apply(CoordinateSequenceFilter filter) { if (geometries.length == 0) return; @@ -204,6 +220,7 @@ public void apply(CoordinateSequenceFilter filter) { geometryChanged(); } + @Override public void apply(GeometryFilter filter) { filter.filter(this); for (int i = 0; i < geometries.length; i++) { @@ -211,6 +228,7 @@ public void apply(GeometryFilter filter) { } } + @Override public void apply(GeometryComponentFilter filter) { filter.filter(this); for (int i = 0; i < geometries.length; i++) { @@ -225,10 +243,12 @@ public void apply(GeometryComponentFilter filter) { * @return a clone of this instance * @deprecated */ + @Override public Object clone() { return copy(); } + @Override protected GeometryCollection copyInternal() { Geometry[] geometries = new Geometry[this.geometries.length]; for (int i = 0; i < geometries.length; i++) { @@ -237,6 +257,7 @@ protected GeometryCollection copyInternal() { return new GeometryCollection(geometries, factory); } + @Override public void normalize() { for (int i = 0; i < geometries.length; i++) { geometries[i].normalize(); @@ -244,6 +265,7 @@ public void normalize() { Arrays.sort(geometries); } + @Override protected Envelope computeEnvelopeInternal() { Envelope envelope = new Envelope(); for (int i = 0; i < geometries.length; i++) { @@ -252,12 +274,14 @@ protected Envelope computeEnvelopeInternal() { return envelope; } + @Override protected int compareToSameClass(Object o) { TreeSet theseElements = new TreeSet(Arrays.asList(geometries)); TreeSet otherElements = new TreeSet(Arrays.asList(((GeometryCollection) o).geometries)); return compare(theseElements, otherElements); } + @Override protected int compareToSameClass(Object o, CoordinateSequenceComparator comp) { GeometryCollection gc = (GeometryCollection) o; @@ -277,6 +301,7 @@ protected int compareToSameClass(Object o, CoordinateSequenceComparator comp) { } + @Override protected int getTypeCode() { return Geometry.TYPECODE_GEOMETRYCOLLECTION; } @@ -288,10 +313,12 @@ protected int getTypeCode() { * * @return a {@link GeometryCollection} in the reverse order */ + @Override public GeometryCollection reverse() { return (GeometryCollection) super.reverse(); } + @Override protected GeometryCollection reverseInternal() { Geometry[] geometries = new Geometry[this.geometries.length]; diff --git a/modules/core/src/main/java/org/locationtech/jts/geom/GeometryCollectionIterator.java b/modules/core/src/main/java/org/locationtech/jts/geom/GeometryCollectionIterator.java index dfeecf50c9..23ec1e895c 100644 --- a/modules/core/src/main/java/org/locationtech/jts/geom/GeometryCollectionIterator.java +++ b/modules/core/src/main/java/org/locationtech/jts/geom/GeometryCollectionIterator.java @@ -71,6 +71,7 @@ public GeometryCollectionIterator(Geometry parent) { * * @return true if more geometry elements remain */ + @Override public boolean hasNext() { if (atStart) { return true; @@ -92,6 +93,7 @@ public boolean hasNext() { * * @return the next geometry in the iteration */ + @Override public Object next() { // the parent GeometryCollection is the first object returned if (atStart) { @@ -130,6 +132,7 @@ private static boolean isAtomic(Geometry geom) * * @throws UnsupportedOperationException This method is not implemented. */ + @Override public void remove() { throw new UnsupportedOperationException(getClass().getName()); } diff --git a/modules/core/src/main/java/org/locationtech/jts/geom/GeometryFactory.java b/modules/core/src/main/java/org/locationtech/jts/geom/GeometryFactory.java index de8da951db..c34e05c373 100644 --- a/modules/core/src/main/java/org/locationtech/jts/geom/GeometryFactory.java +++ b/modules/core/src/main/java/org/locationtech/jts/geom/GeometryFactory.java @@ -667,6 +667,7 @@ private static class CoordSeqCloneOp extends GeometryEditor.CoordinateSequenceOp public CoordSeqCloneOp(CoordinateSequenceFactory coordinateSequenceFactory) { this.coordinateSequenceFactory = coordinateSequenceFactory; } + @Override public CoordinateSequence edit(CoordinateSequence coordSeq, Geometry geometry) { return coordinateSequenceFactory.create(coordSeq); } diff --git a/modules/core/src/main/java/org/locationtech/jts/geom/GeometryOverlay.java b/modules/core/src/main/java/org/locationtech/jts/geom/GeometryOverlay.java index 0d81f0e24a..0c1c207a41 100644 --- a/modules/core/src/main/java/org/locationtech/jts/geom/GeometryOverlay.java +++ b/modules/core/src/main/java/org/locationtech/jts/geom/GeometryOverlay.java @@ -106,6 +106,7 @@ static Geometry intersection(Geometry a, Geometry b) return GeometryCollectionMapper.map( (GeometryCollection) a, new GeometryMapper.MapOp() { + @Override public Geometry map(Geometry g) { return g.intersection(g2); } diff --git a/modules/core/src/main/java/org/locationtech/jts/geom/LineSegment.java b/modules/core/src/main/java/org/locationtech/jts/geom/LineSegment.java index 9dd72a6d1f..2839394161 100644 --- a/modules/core/src/main/java/org/locationtech/jts/geom/LineSegment.java +++ b/modules/core/src/main/java/org/locationtech/jts/geom/LineSegment.java @@ -704,6 +704,7 @@ public int OLDhashCode() { *@return a negative integer, zero, or a positive integer as this LineSegment * is less than, equal to, or greater than the specified LineSegment */ + @Override public int compareTo(Object o) { LineSegment other = (LineSegment) o; int comp0 = p0.compareTo(other.p0); diff --git a/modules/core/src/main/java/org/locationtech/jts/geom/LineString.java b/modules/core/src/main/java/org/locationtech/jts/geom/LineString.java index bf79badbc6..619def38fe 100644 --- a/modules/core/src/main/java/org/locationtech/jts/geom/LineString.java +++ b/modules/core/src/main/java/org/locationtech/jts/geom/LineString.java @@ -91,6 +91,7 @@ private void init(CoordinateSequence points) this.points = points; } + @Override public Coordinate[] getCoordinates() { return points.toCoordinateArray(); } @@ -103,16 +104,19 @@ public Coordinate getCoordinateN(int n) { return points.getCoordinate(n); } + @Override public Coordinate getCoordinate() { if (isEmpty()) return null; return points.getCoordinate(0); } + @Override public int getDimension() { return 1; } + @Override public int getBoundaryDimension() { if (isClosed()) { return Dimension.FALSE; @@ -120,10 +124,12 @@ public int getBoundaryDimension() { return 0; } + @Override public boolean isEmpty() { return points.size() == 0; } + @Override public int getNumPoints() { return points.size(); } @@ -157,6 +163,7 @@ public boolean isRing() { return isClosed() && isSimple(); } + @Override public String getGeometryType() { return Geometry.TYPENAME_LINESTRING; } @@ -166,6 +173,7 @@ public String getGeometryType() { * *@return the length of the linestring */ + @Override public double getLength() { return Length.ofLine(points); @@ -178,6 +186,7 @@ public double getLength() * @return the boundary geometry * @see Geometry#getBoundary */ + @Override public Geometry getBoundary() { return (new BoundaryOp(this)).getBoundary(); } @@ -188,10 +197,12 @@ public Geometry getBoundary() { * * @return a {@link LineString} with coordinates in the reverse order */ + @Override public LineString reverse() { return (LineString) super.reverse(); } + @Override protected LineString reverseInternal() { CoordinateSequence seq = points.copy(); @@ -215,6 +226,7 @@ public boolean isCoordinate(Coordinate pt) { return false; } + @Override protected Envelope computeEnvelopeInternal() { if (isEmpty()) { return new Envelope(); @@ -222,6 +234,7 @@ protected Envelope computeEnvelopeInternal() { return points.expandEnvelope(new Envelope()); } + @Override public boolean equalsExact(Geometry other, double tolerance) { if (!isEquivalentClass(other)) { return false; @@ -238,12 +251,14 @@ public boolean equalsExact(Geometry other, double tolerance) { return true; } + @Override public void apply(CoordinateFilter filter) { for (int i = 0; i < points.size(); i++) { filter.filter(points.getCoordinate(i)); } } + @Override public void apply(CoordinateSequenceFilter filter) { if (points.size() == 0) @@ -257,10 +272,12 @@ public void apply(CoordinateSequenceFilter filter) geometryChanged(); } + @Override public void apply(GeometryFilter filter) { filter.filter(this); } + @Override public void apply(GeometryComponentFilter filter) { filter.filter(this); } @@ -272,10 +289,12 @@ public void apply(GeometryComponentFilter filter) { * @return a clone of this instance * @deprecated */ + @Override public Object clone() { return copy(); } + @Override protected LineString copyInternal() { return new LineString(points.copy(), factory); } @@ -285,6 +304,7 @@ protected LineString copyInternal() { * has the first point which is not equal to it's reflected point * less than the reflected point. */ + @Override public void normalize() { for (int i = 0; i < points.size() / 2; i++) { @@ -301,10 +321,12 @@ public void normalize() } } + @Override protected boolean isEquivalentClass(Geometry other) { return other instanceof LineString; } + @Override protected int compareToSameClass(Object o) { LineString line = (LineString) o; @@ -328,12 +350,14 @@ protected int compareToSameClass(Object o) return 0; } + @Override protected int compareToSameClass(Object o, CoordinateSequenceComparator comp) { LineString line = (LineString) o; return comp.compare(this.points, line.points); } + @Override protected int getTypeCode() { return Geometry.TYPECODE_LINESTRING; } diff --git a/modules/core/src/main/java/org/locationtech/jts/geom/LinearRing.java b/modules/core/src/main/java/org/locationtech/jts/geom/LinearRing.java index c903bd4246..d49deb8019 100644 --- a/modules/core/src/main/java/org/locationtech/jts/geom/LinearRing.java +++ b/modules/core/src/main/java/org/locationtech/jts/geom/LinearRing.java @@ -102,6 +102,7 @@ private void validateConstruction() { * * @return Dimension.FALSE */ + @Override public int getBoundaryDimension() { return Dimension.FALSE; } @@ -112,6 +113,7 @@ public int getBoundaryDimension() { * * @return true if this ring is closed */ + @Override public boolean isClosed() { if (isEmpty()) { // empty LinearRings are closed by definition @@ -121,23 +123,28 @@ public boolean isClosed() { } + @Override public String getGeometryType() { return Geometry.TYPENAME_LINEARRING; } + @Override protected int getTypeCode() { return Geometry.TYPECODE_LINEARRING; } + @Override protected LinearRing copyInternal() { return new LinearRing(points.copy(), factory); } + @Override public LinearRing reverse() { return (LinearRing) super.reverse(); } + @Override public LinearRing reverseInternal() { CoordinateSequence seq = points.copy(); CoordinateSequences.reverse(seq); diff --git a/modules/core/src/main/java/org/locationtech/jts/geom/MultiLineString.java b/modules/core/src/main/java/org/locationtech/jts/geom/MultiLineString.java index 418f688f04..65a52c671a 100644 --- a/modules/core/src/main/java/org/locationtech/jts/geom/MultiLineString.java +++ b/modules/core/src/main/java/org/locationtech/jts/geom/MultiLineString.java @@ -55,14 +55,17 @@ public MultiLineString(LineString[] lineStrings, GeometryFactory factory) { super(lineStrings, factory); } + @Override public int getDimension() { return 1; } + @Override public boolean hasDimension(int dim) { return dim == 1; } + @Override public int getBoundaryDimension() { if (isClosed()) { return Dimension.FALSE; @@ -70,6 +73,7 @@ public int getBoundaryDimension() { return 0; } + @Override public String getGeometryType() { return Geometry.TYPENAME_MULTILINESTRING; } @@ -93,6 +97,7 @@ public boolean isClosed() { * @return the boundary geometry * @see Geometry#getBoundary */ + @Override public Geometry getBoundary() { return (new BoundaryOp(this)).getBoundary(); @@ -107,10 +112,12 @@ public Geometry getBoundary() * * @return a {@link MultiLineString} in the reverse order */ + @Override public MultiLineString reverse() { return (MultiLineString) super.reverse(); } + @Override protected MultiLineString reverseInternal() { LineString[] lineStrings = new LineString[this.geometries.length]; for (int i = 0; i < lineStrings.length; i++) { @@ -119,6 +126,7 @@ protected MultiLineString reverseInternal() { return new MultiLineString(lineStrings, factory); } + @Override protected MultiLineString copyInternal() { LineString[] lineStrings = new LineString[this.geometries.length]; for (int i = 0; i < lineStrings.length; i++) { @@ -127,6 +135,7 @@ protected MultiLineString copyInternal() { return new MultiLineString(lineStrings, factory); } + @Override public boolean equalsExact(Geometry other, double tolerance) { if (!isEquivalentClass(other)) { return false; @@ -134,6 +143,7 @@ public boolean equalsExact(Geometry other, double tolerance) { return super.equalsExact(other, tolerance); } + @Override protected int getTypeCode() { return Geometry.TYPECODE_MULTILINESTRING; } diff --git a/modules/core/src/main/java/org/locationtech/jts/geom/MultiPoint.java b/modules/core/src/main/java/org/locationtech/jts/geom/MultiPoint.java index c1d73a80d3..ed918d3b17 100644 --- a/modules/core/src/main/java/org/locationtech/jts/geom/MultiPoint.java +++ b/modules/core/src/main/java/org/locationtech/jts/geom/MultiPoint.java @@ -50,18 +50,22 @@ public MultiPoint(Point[] points, GeometryFactory factory) { super(points, factory); } + @Override public int getDimension() { return 0; } + @Override public boolean hasDimension(int dim) { return dim == 0; } + @Override public int getBoundaryDimension() { return Dimension.FALSE; } + @Override public String getGeometryType() { return Geometry.TYPENAME_MULTIPOINT; } @@ -74,14 +78,17 @@ public String getGeometryType() { * @return an empty GeometryCollection * @see Geometry#getBoundary */ + @Override public Geometry getBoundary() { return getFactory().createGeometryCollection(); } + @Override public MultiPoint reverse() { return (MultiPoint) super.reverse(); } + @Override protected MultiPoint reverseInternal() { Point[] points = new Point[this.geometries.length]; for (int i = 0; i < points.length; i++) { @@ -90,6 +97,7 @@ protected MultiPoint reverseInternal() { return new MultiPoint(points, factory); } + @Override public boolean equalsExact(Geometry other, double tolerance) { if (!isEquivalentClass(other)) { return false; @@ -108,6 +116,7 @@ protected Coordinate getCoordinate(int n) { return ((Point) geometries[n]).getCoordinate(); } + @Override protected MultiPoint copyInternal() { Point[] points = new Point[this.geometries.length]; for (int i = 0; i < points.length; i++) { @@ -116,6 +125,7 @@ protected MultiPoint copyInternal() { return new MultiPoint(points, factory); } + @Override protected int getTypeCode() { return Geometry.TYPECODE_MULTIPOINT; } diff --git a/modules/core/src/main/java/org/locationtech/jts/geom/MultiPolygon.java b/modules/core/src/main/java/org/locationtech/jts/geom/MultiPolygon.java index 23284a6d82..5256aa41de 100644 --- a/modules/core/src/main/java/org/locationtech/jts/geom/MultiPolygon.java +++ b/modules/core/src/main/java/org/locationtech/jts/geom/MultiPolygon.java @@ -64,18 +64,22 @@ public MultiPolygon(Polygon[] polygons, GeometryFactory factory) { super(polygons, factory); } + @Override public int getDimension() { return 2; } + @Override public boolean hasDimension(int dim) { return dim == 2; } + @Override public int getBoundaryDimension() { return 1; } + @Override public String getGeometryType() { return Geometry.TYPENAME_MULTIPOLYGON; } @@ -92,6 +96,7 @@ public boolean isSimple() { * @return a lineal geometry (which may be empty) * @see Geometry#getBoundary */ + @Override public Geometry getBoundary() { if (isEmpty()) { return getFactory().createMultiLineString(); @@ -108,6 +113,7 @@ public Geometry getBoundary() { return getFactory().createMultiLineString((LineString[]) allRings.toArray(allRingsArray)); } + @Override public boolean equalsExact(Geometry other, double tolerance) { if (!isEquivalentClass(other)) { return false; @@ -122,10 +128,12 @@ public boolean equalsExact(Geometry other, double tolerance) { * * @return a MultiPolygon in the reverse order */ + @Override public MultiPolygon reverse() { return (MultiPolygon) super.reverse(); } + @Override protected MultiPolygon reverseInternal() { Polygon[] polygons = new Polygon[this.geometries.length]; for (int i = 0; i < polygons.length; i++) { @@ -134,6 +142,7 @@ protected MultiPolygon reverseInternal() { return new MultiPolygon(polygons, factory); } + @Override protected MultiPolygon copyInternal() { Polygon[] polygons = new Polygon[this.geometries.length]; for (int i = 0; i < polygons.length; i++) { @@ -142,6 +151,7 @@ protected MultiPolygon copyInternal() { return new MultiPolygon(polygons, factory); } + @Override protected int getTypeCode() { return Geometry.TYPECODE_MULTIPOLYGON; } diff --git a/modules/core/src/main/java/org/locationtech/jts/geom/OctagonalEnvelope.java b/modules/core/src/main/java/org/locationtech/jts/geom/OctagonalEnvelope.java index 0269aea3d8..469bb3de4f 100644 --- a/modules/core/src/main/java/org/locationtech/jts/geom/OctagonalEnvelope.java +++ b/modules/core/src/main/java/org/locationtech/jts/geom/OctagonalEnvelope.java @@ -349,6 +349,7 @@ private static class BoundingOctagonComponentFilter this.oe = oe; } + @Override public void filter(Geometry geom) { if (geom instanceof LineString) { diff --git a/modules/core/src/main/java/org/locationtech/jts/geom/Point.java b/modules/core/src/main/java/org/locationtech/jts/geom/Point.java index cbe145416f..4b082fce0a 100644 --- a/modules/core/src/main/java/org/locationtech/jts/geom/Point.java +++ b/modules/core/src/main/java/org/locationtech/jts/geom/Point.java @@ -69,28 +69,34 @@ private void init(CoordinateSequence coordinates) this.coordinates = coordinates; } + @Override public Coordinate[] getCoordinates() { return isEmpty() ? new Coordinate[]{} : new Coordinate[]{ getCoordinate() }; } + @Override public int getNumPoints() { return isEmpty() ? 0 : 1; } + @Override public boolean isEmpty() { return coordinates.size() == 0; } + @Override public boolean isSimple() { return true; } + @Override public int getDimension() { return 0; } + @Override public int getBoundaryDimension() { return Dimension.FALSE; } @@ -109,10 +115,12 @@ public double getY() { return getCoordinate().y; } + @Override public Coordinate getCoordinate() { return coordinates.size() != 0 ? coordinates.getCoordinate(0): null; } + @Override public String getGeometryType() { return Geometry.TYPENAME_POINT; } @@ -125,10 +133,12 @@ public String getGeometryType() { * @return an empty GeometryCollection * @see Geometry#getBoundary */ + @Override public Geometry getBoundary() { return getFactory().createGeometryCollection(); } + @Override protected Envelope computeEnvelopeInternal() { if (isEmpty()) { return new Envelope(); @@ -138,6 +148,7 @@ protected Envelope computeEnvelopeInternal() { return env; } + @Override public boolean equalsExact(Geometry other, double tolerance) { if (!isEquivalentClass(other)) { return false; @@ -151,11 +162,13 @@ public boolean equalsExact(Geometry other, double tolerance) { return equal(((Point) other).getCoordinate(), this.getCoordinate(), tolerance); } + @Override public void apply(CoordinateFilter filter) { if (isEmpty()) { return; } filter.filter(getCoordinate()); } + @Override public void apply(CoordinateSequenceFilter filter) { if (isEmpty()) @@ -165,10 +178,12 @@ public void apply(CoordinateSequenceFilter filter) geometryChanged(); } + @Override public void apply(GeometryFilter filter) { filter.filter(this); } + @Override public void apply(GeometryComponentFilter filter) { filter.filter(this); } @@ -180,39 +195,47 @@ public void apply(GeometryComponentFilter filter) { * @return a clone of this instance * @deprecated */ + @Override public Object clone() { return copy(); } + @Override protected Point copyInternal() { return new Point(coordinates.copy(), factory); } + @Override public Point reverse() { return (Point) super.reverse(); } + @Override protected Point reverseInternal() { return getFactory().createPoint(coordinates.copy()); } + @Override public void normalize() { // a Point is always in normalized form } + @Override protected int compareToSameClass(Object other) { Point point = (Point) other; return getCoordinate().compareTo(point.getCoordinate()); } + @Override protected int compareToSameClass(Object other, CoordinateSequenceComparator comp) { Point point = (Point) other; return comp.compare(this.coordinates, point.coordinates); } + @Override protected int getTypeCode() { return Geometry.TYPECODE_POINT; } diff --git a/modules/core/src/main/java/org/locationtech/jts/geom/Polygon.java b/modules/core/src/main/java/org/locationtech/jts/geom/Polygon.java index 94a8bc17fa..ee20e3448a 100644 --- a/modules/core/src/main/java/org/locationtech/jts/geom/Polygon.java +++ b/modules/core/src/main/java/org/locationtech/jts/geom/Polygon.java @@ -128,10 +128,12 @@ public Polygon(LinearRing shell, LinearRing[] holes, GeometryFactory factory) { this.holes = holes; } + @Override public Coordinate getCoordinate() { return shell.getCoordinate(); } + @Override public Coordinate[] getCoordinates() { if (isEmpty()) { return new Coordinate[]{}; @@ -153,6 +155,7 @@ public Coordinate[] getCoordinates() { return coordinates; } + @Override public int getNumPoints() { int numPoints = shell.getNumPoints(); for (int i = 0; i < holes.length; i++) { @@ -161,18 +164,22 @@ public int getNumPoints() { return numPoints; } + @Override public int getDimension() { return 2; } + @Override public int getBoundaryDimension() { return 1; } + @Override public boolean isEmpty() { return shell.isEmpty(); } + @Override public boolean isRectangle() { if (getNumInteriorRing() != 0) return false; @@ -218,6 +225,7 @@ public LinearRing getInteriorRingN(int n) { return holes[n]; } + @Override public String getGeometryType() { return Geometry.TYPENAME_POLYGON; } @@ -227,6 +235,7 @@ public String getGeometryType() { * *@return the area of the polygon */ + @Override public double getArea() { double area = 0.0; @@ -242,6 +251,7 @@ public double getArea() * *@return the perimeter of the polygon */ + @Override public double getLength() { double len = 0.0; @@ -258,6 +268,7 @@ public double getLength() * @return a lineal geometry (which may be empty) * @see Geometry#getBoundary */ + @Override public Geometry getBoundary() { if (isEmpty()) { return getFactory().createMultiLineString(); @@ -273,10 +284,12 @@ public Geometry getBoundary() { return getFactory().createMultiLineString(rings); } + @Override protected Envelope computeEnvelopeInternal() { return shell.getEnvelopeInternal(); } + @Override public boolean equalsExact(Geometry other, double tolerance) { if (!isEquivalentClass(other)) { return false; @@ -298,6 +311,7 @@ public boolean equalsExact(Geometry other, double tolerance) { return true; } + @Override public void apply(CoordinateFilter filter) { shell.apply(filter); for (int i = 0; i < holes.length; i++) { @@ -305,6 +319,7 @@ public void apply(CoordinateFilter filter) { } } + @Override public void apply(CoordinateSequenceFilter filter) { shell.apply(filter); @@ -319,10 +334,12 @@ public void apply(CoordinateSequenceFilter filter) geometryChanged(); } + @Override public void apply(GeometryFilter filter) { filter.filter(this); } + @Override public void apply(GeometryComponentFilter filter) { filter.filter(this); shell.apply(filter); @@ -338,11 +355,13 @@ public void apply(GeometryComponentFilter filter) { * @return a clone of this instance * @deprecated */ + @Override public Object clone() { return copy(); } + @Override protected Polygon copyInternal() { LinearRing shellCopy = (LinearRing) shell.copy(); LinearRing[] holeCopies = new LinearRing[this.holes.length]; @@ -352,10 +371,12 @@ protected Polygon copyInternal() { return new Polygon(shellCopy, holeCopies, factory); } + @Override public Geometry convexHull() { return getExteriorRing().convexHull(); } + @Override public void normalize() { shell = normalized(shell, true); for (int i = 0; i < holes.length; i++) { @@ -364,6 +385,7 @@ public void normalize() { Arrays.sort(holes); } + @Override protected int compareToSameClass(Object o) { Polygon poly = (Polygon) o; @@ -387,6 +409,7 @@ protected int compareToSameClass(Object o) { return 0; } + @Override protected int compareToSameClass(Object o, CoordinateSequenceComparator comp) { Polygon poly = (Polygon) o; @@ -410,6 +433,7 @@ protected int compareToSameClass(Object o, CoordinateSequenceComparator comp) { return 0; } + @Override protected int getTypeCode() { return Geometry.TYPECODE_POLYGON; } @@ -432,10 +456,12 @@ private void normalize(LinearRing ring, boolean clockwise) { CoordinateSequences.reverse(seq); } + @Override public Polygon reverse() { return (Polygon) super.reverse(); } + @Override protected Polygon reverseInternal() { LinearRing shell = (LinearRing) getExteriorRing().reverse(); diff --git a/modules/core/src/main/java/org/locationtech/jts/geom/PrecisionModel.java b/modules/core/src/main/java/org/locationtech/jts/geom/PrecisionModel.java index f8ab294125..94780de314 100644 --- a/modules/core/src/main/java/org/locationtech/jts/geom/PrecisionModel.java +++ b/modules/core/src/main/java/org/locationtech/jts/geom/PrecisionModel.java @@ -500,6 +500,7 @@ public int hashCode() { *@return a negative integer, zero, or a positive integer as this PrecisionModel * is less than, equal to, or greater than the specified PrecisionModel */ + @Override public int compareTo(Object o) { PrecisionModel other = (PrecisionModel) o; diff --git a/modules/core/src/main/java/org/locationtech/jts/geom/impl/CoordinateArraySequence.java b/modules/core/src/main/java/org/locationtech/jts/geom/impl/CoordinateArraySequence.java index 1ef139253e..1745c32830 100644 --- a/modules/core/src/main/java/org/locationtech/jts/geom/impl/CoordinateArraySequence.java +++ b/modules/core/src/main/java/org/locationtech/jts/geom/impl/CoordinateArraySequence.java @@ -168,6 +168,7 @@ public CoordinateArraySequence(CoordinateSequence coordSeq) /** * @see org.locationtech.jts.geom.CoordinateSequence#getDimension() */ + @Override public int getDimension() { return dimension; @@ -186,6 +187,7 @@ public int getMeasures() * the index of the coordinate * @return the requested Coordinate instance */ + @Override public Coordinate getCoordinate(int i) { return coordinates[i]; } @@ -196,6 +198,7 @@ public Coordinate getCoordinate(int i) { * @param i the index of the coordinate * @return a copy of the requested Coordinate */ + @Override public Coordinate getCoordinateCopy(int i) { Coordinate copy = createCoordinate(); copy.setCoordinate(coordinates[i]); @@ -205,6 +208,7 @@ public Coordinate getCoordinateCopy(int i) { /** * @see org.locationtech.jts.geom.CoordinateSequence#getX(int) */ + @Override public void getCoordinate(int index, Coordinate coord) { coord.setCoordinate(coordinates[index]); } @@ -212,6 +216,7 @@ public void getCoordinate(int index, Coordinate coord) { /** * @see org.locationtech.jts.geom.CoordinateSequence#getX(int) */ + @Override public double getX(int index) { return coordinates[index].x; } @@ -219,6 +224,7 @@ public double getX(int index) { /** * @see org.locationtech.jts.geom.CoordinateSequence#getY(int) */ + @Override public double getY(int index) { return coordinates[index].y; } @@ -226,6 +232,7 @@ public double getY(int index) { /** * @see org.locationtech.jts.geom.CoordinateSequence#getZ(int) */ + @Override public double getZ(int index) { if (hasZ()) { @@ -239,6 +246,7 @@ public double getZ(int index) /** * @see org.locationtech.jts.geom.CoordinateSequence#getM(int) */ + @Override public double getM(int index) { if (hasM()) { return coordinates[index].getM(); @@ -251,6 +259,7 @@ public double getM(int index) { /** * @see org.locationtech.jts.geom.CoordinateSequence#getOrdinate(int, int) */ + @Override public double getOrdinate(int index, int ordinateIndex) { switch (ordinateIndex) { @@ -267,6 +276,7 @@ public double getOrdinate(int index, int ordinateIndex) * @return The deep copy * @deprecated */ + @Override public Object clone() { return copy(); } @@ -275,6 +285,7 @@ public Object clone() { * * @return The deep copy */ + @Override public CoordinateArraySequence copy() { Coordinate[] cloneCoordinates = new Coordinate[size()]; for (int i = 0; i < coordinates.length; i++) { @@ -289,6 +300,7 @@ public CoordinateArraySequence copy() { * * @return the number of coordinates */ + @Override public int size() { return coordinates.length; } @@ -296,6 +308,7 @@ public int size() { /** * @see org.locationtech.jts.geom.CoordinateSequence#setOrdinate(int, int, double) */ + @Override public void setOrdinate(int index, int ordinateIndex, double value) { switch (ordinateIndex) { @@ -315,10 +328,12 @@ public void setOrdinate(int index, int ordinateIndex, double value) * * @return the Coordinate[] array. */ + @Override public Coordinate[] toCoordinateArray() { return coordinates; } + @Override public Envelope expandEnvelope(Envelope env) { for (int i = 0; i < coordinates.length; i++ ) { diff --git a/modules/core/src/main/java/org/locationtech/jts/geom/impl/CoordinateArraySequenceFactory.java b/modules/core/src/main/java/org/locationtech/jts/geom/impl/CoordinateArraySequenceFactory.java index a0c7df5c15..e72e9391b5 100644 --- a/modules/core/src/main/java/org/locationtech/jts/geom/impl/CoordinateArraySequenceFactory.java +++ b/modules/core/src/main/java/org/locationtech/jts/geom/impl/CoordinateArraySequenceFactory.java @@ -51,6 +51,7 @@ public static CoordinateArraySequenceFactory instance() { * the coordinates, which may not be null nor contain null * elements */ + @Override public CoordinateSequence create(Coordinate[] coordinates) { return new CoordinateArraySequence(coordinates); } @@ -58,6 +59,7 @@ public CoordinateSequence create(Coordinate[] coordinates) { /** * @see org.locationtech.jts.geom.CoordinateSequenceFactory#create(org.locationtech.jts.geom.CoordinateSequence) */ + @Override public CoordinateSequence create(CoordinateSequence coordSeq) { return new CoordinateArraySequence(coordSeq); } @@ -68,6 +70,7 @@ public CoordinateSequence create(CoordinateSequence coordSeq) { * @see org.locationtech.jts.geom.CoordinateSequenceFactory#create(int, int) * */ + @Override public CoordinateSequence create(int size, int dimension) { if (dimension > 3) dimension = 3; @@ -80,6 +83,7 @@ public CoordinateSequence create(int size, int dimension) { return new CoordinateArraySequence(size, dimension); } + @Override public CoordinateSequence create(int size, int dimension, int measures) { int spatial = dimension - measures; diff --git a/modules/core/src/main/java/org/locationtech/jts/geom/impl/PackedCoordinateSequence.java b/modules/core/src/main/java/org/locationtech/jts/geom/impl/PackedCoordinateSequence.java index ed23960e3b..facd399d41 100644 --- a/modules/core/src/main/java/org/locationtech/jts/geom/impl/PackedCoordinateSequence.java +++ b/modules/core/src/main/java/org/locationtech/jts/geom/impl/PackedCoordinateSequence.java @@ -74,6 +74,7 @@ protected PackedCoordinateSequence(int dimension, int measures ) { /** * @see CoordinateSequence#getDimension() */ + @Override public int getDimension() { return this.dimension; } @@ -89,6 +90,7 @@ public int getMeasures() { /** * @see CoordinateSequence#getCoordinate(int) */ + @Override public Coordinate getCoordinate(int i) { Coordinate[] coords = getCachedCoords(); if(coords != null) @@ -99,6 +101,7 @@ public Coordinate getCoordinate(int i) { /** * @see CoordinateSequence#getCoordinate(int) */ + @Override public Coordinate getCoordinateCopy(int i) { return getCoordinateInternal(i); } @@ -106,6 +109,7 @@ public Coordinate getCoordinateCopy(int i) { /** * @see CoordinateSequence#getCoordinate(int) */ + @Override public void getCoordinate(int i, Coordinate coord) { coord.x = getOrdinate(i, 0); coord.y = getOrdinate(i, 1); @@ -120,6 +124,7 @@ public void getCoordinate(int i, Coordinate coord) { /** * @see CoordinateSequence#toCoordinateArray() */ + @Override public Coordinate[] toCoordinateArray() { Coordinate[] coords = getCachedCoords(); // testing - never cache @@ -155,6 +160,7 @@ private Coordinate[] getCachedCoords() { /** * @see CoordinateSequence#getX(int) */ + @Override public double getX(int index) { return getOrdinate(index, 0); } @@ -162,6 +168,7 @@ public double getX(int index) { /** * @see CoordinateSequence#getY(int) */ + @Override public double getY(int index) { return getOrdinate(index, 1); } @@ -169,6 +176,7 @@ public double getY(int index) { /** * @see CoordinateSequence#getOrdinate(int, int) */ + @Override public abstract double getOrdinate(int index, int ordinateIndex); /** @@ -217,8 +225,10 @@ protected Object readResolve() throws ObjectStreamException { * @see CoordinateSequence#clone() * @deprecated */ + @Override public abstract Object clone(); + @Override public abstract PackedCoordinateSequence copy(); /** @@ -235,6 +245,7 @@ protected Object readResolve() throws ObjectStreamException { * @param value * the new ordinate value */ + @Override public abstract void setOrdinate(int index, int ordinate, double value); /** @@ -334,6 +345,7 @@ public Double(int size, int dimension, int measures) { /** * @see PackedCoordinateSequence#getCoordinate(int) */ + @Override public Coordinate getCoordinateInternal(int i) { double x = coords[i * dimension]; double y = coords[i * dimension + 1]; @@ -369,6 +381,7 @@ public double[] getRawCoordinates() /** * @see CoordinateSequence#size() */ + @Override public int size() { return coords.length / dimension; } @@ -378,6 +391,7 @@ public int size() { * @see PackedCoordinateSequence#clone() * @deprecated */ + @Override public Object clone() { return copy(); } @@ -385,6 +399,7 @@ public Object clone() { /** * @see PackedCoordinateSequence#size() */ + @Override public Double copy() { double[] clone = Arrays.copyOf(coords, coords.length); return new Double(clone, dimension, measures); @@ -396,6 +411,7 @@ public Double copy() { * it's over dimensions you may not get an exception but a meaningless * value. */ + @Override public double getOrdinate(int index, int ordinate) { return coords[index * dimension + ordinate]; } @@ -403,6 +419,7 @@ public double getOrdinate(int index, int ordinate) { /** * @see PackedCoordinateSequence#setOrdinate(int, int, double) */ + @Override public void setOrdinate(int index, int ordinate, double value) { coordRef = null; coords[index * dimension + ordinate] = value; @@ -411,6 +428,7 @@ public void setOrdinate(int index, int ordinate, double value) { /** * @see CoordinateSequence#expandEnvelope(Envelope) */ + @Override public Envelope expandEnvelope(Envelope env) { for (int i = 0; i < coords.length; i += dimension ) { @@ -514,6 +532,7 @@ public Float(int size, int dimension,int measures) { /** * @see PackedCoordinateSequence#getCoordinate(int) */ + @Override public Coordinate getCoordinateInternal(int i) { double x = coords[i * dimension]; double y = coords[i * dimension + 1]; @@ -549,6 +568,7 @@ public float[] getRawCoordinates() /** * @see CoordinateSequence#size() */ + @Override public int size() { return coords.length / dimension; } @@ -558,6 +578,7 @@ public int size() { * @see PackedCoordinateSequence#clone() * @deprecated */ + @Override public Object clone() { return copy(); } @@ -565,6 +586,7 @@ public Object clone() { /** * @see PackedCoordinateSequence#copy() */ + @Override public Float copy() { float[] clone = Arrays.copyOf(coords, coords.length); return new Float(clone, dimension,measures); @@ -576,6 +598,7 @@ public Float copy() { * If it is larger than the dimension a meaningless * value may be returned. */ + @Override public double getOrdinate(int index, int ordinate) { return coords[index * dimension + ordinate]; } @@ -583,6 +606,7 @@ public double getOrdinate(int index, int ordinate) { /** * @see PackedCoordinateSequence#setOrdinate(int, int, double) */ + @Override public void setOrdinate(int index, int ordinate, double value) { coordRef = null; coords[index * dimension + ordinate] = (float) value; @@ -591,6 +615,7 @@ public void setOrdinate(int index, int ordinate, double value) { /** * @see CoordinateSequence#expandEnvelope(Envelope) */ + @Override public Envelope expandEnvelope(Envelope env) { for (int i = 0; i < coords.length; i += dimension ) { diff --git a/modules/core/src/main/java/org/locationtech/jts/geom/impl/PackedCoordinateSequenceFactory.java b/modules/core/src/main/java/org/locationtech/jts/geom/impl/PackedCoordinateSequenceFactory.java index 35ed9e333a..e1a7204b5e 100644 --- a/modules/core/src/main/java/org/locationtech/jts/geom/impl/PackedCoordinateSequenceFactory.java +++ b/modules/core/src/main/java/org/locationtech/jts/geom/impl/PackedCoordinateSequenceFactory.java @@ -90,6 +90,7 @@ public int getType() { /** * @see CoordinateSequenceFactory#create(Coordinate[]) */ + @Override public CoordinateSequence create(Coordinate[] coordinates) { int dimension = DEFAULT_DIMENSION; int measures = DEFAULT_MEASURES; @@ -108,6 +109,7 @@ public CoordinateSequence create(Coordinate[] coordinates) { /** * @see CoordinateSequenceFactory#create(CoordinateSequence) */ + @Override public CoordinateSequence create(CoordinateSequence coordSeq) { int dimension = coordSeq.getDimension(); int measures = coordSeq.getMeasures(); @@ -180,6 +182,7 @@ public CoordinateSequence create(float[] packedCoordinates, int dimension, int m /** * @see org.locationtech.jts.geom.CoordinateSequenceFactory#create(int, int) */ + @Override public CoordinateSequence create(int size, int dimension) { if (type == DOUBLE) { return new PackedCoordinateSequence.Double( @@ -193,6 +196,7 @@ public CoordinateSequence create(int size, int dimension) { /** * @see org.locationtech.jts.geom.CoordinateSequenceFactory#create(int, int, int) */ + @Override public CoordinateSequence create(int size, int dimension, int measures) { if (type == DOUBLE) { return new PackedCoordinateSequence.Double(size, dimension, measures); diff --git a/modules/core/src/main/java/org/locationtech/jts/geom/prep/BasicPreparedGeometry.java b/modules/core/src/main/java/org/locationtech/jts/geom/prep/BasicPreparedGeometry.java index dd2af14ec9..86b596f45d 100644 --- a/modules/core/src/main/java/org/locationtech/jts/geom/prep/BasicPreparedGeometry.java +++ b/modules/core/src/main/java/org/locationtech/jts/geom/prep/BasicPreparedGeometry.java @@ -43,6 +43,7 @@ public BasicPreparedGeometry(Geometry geom) representativePts = ComponentCoordinateExtracter.getCoordinates(geom); } + @Override public Geometry getGeometry() { return baseGeom; } /** @@ -111,6 +112,7 @@ protected boolean envelopeCovers(Geometry g) /** * Default implementation. */ + @Override public boolean contains(Geometry g) { return baseGeom.contains(g); @@ -119,6 +121,7 @@ public boolean contains(Geometry g) /** * Default implementation. */ + @Override public boolean containsProperly(Geometry g) { // since raw relate is used, provide some optimizations @@ -134,6 +137,7 @@ public boolean containsProperly(Geometry g) /** * Default implementation. */ + @Override public boolean coveredBy(Geometry g) { return baseGeom.coveredBy(g); @@ -142,6 +146,7 @@ public boolean coveredBy(Geometry g) /** * Default implementation. */ + @Override public boolean covers(Geometry g) { return baseGeom.covers(g); @@ -150,6 +155,7 @@ public boolean covers(Geometry g) /** * Default implementation. */ + @Override public boolean crosses(Geometry g) { return baseGeom.crosses(g); @@ -159,6 +165,7 @@ public boolean crosses(Geometry g) * Standard implementation for all geometries. * Supports {@link GeometryCollection}s as input. */ + @Override public boolean disjoint(Geometry g) { return ! intersects(g); @@ -167,6 +174,7 @@ public boolean disjoint(Geometry g) /** * Default implementation. */ + @Override public boolean intersects(Geometry g) { return baseGeom.intersects(g); @@ -175,6 +183,7 @@ public boolean intersects(Geometry g) /** * Default implementation. */ + @Override public boolean overlaps(Geometry g) { return baseGeom.overlaps(g); @@ -183,6 +192,7 @@ public boolean overlaps(Geometry g) /** * Default implementation. */ + @Override public boolean touches(Geometry g) { return baseGeom.touches(g); @@ -191,6 +201,7 @@ public boolean touches(Geometry g) /** * Default implementation. */ + @Override public boolean within(Geometry g) { return baseGeom.within(g); diff --git a/modules/core/src/main/java/org/locationtech/jts/geom/prep/PreparedLineString.java b/modules/core/src/main/java/org/locationtech/jts/geom/prep/PreparedLineString.java index 63d0e32c50..e0ad00017a 100644 --- a/modules/core/src/main/java/org/locationtech/jts/geom/prep/PreparedLineString.java +++ b/modules/core/src/main/java/org/locationtech/jts/geom/prep/PreparedLineString.java @@ -46,6 +46,7 @@ public synchronized FastSegmentSetIntersectionFinder getIntersectionFinder() return segIntFinder; } + @Override public boolean intersects(Geometry g) { if (! envelopesIntersect(g)) return false; diff --git a/modules/core/src/main/java/org/locationtech/jts/geom/prep/PreparedPoint.java b/modules/core/src/main/java/org/locationtech/jts/geom/prep/PreparedPoint.java index c234b8dabe..2671e950f3 100644 --- a/modules/core/src/main/java/org/locationtech/jts/geom/prep/PreparedPoint.java +++ b/modules/core/src/main/java/org/locationtech/jts/geom/prep/PreparedPoint.java @@ -36,6 +36,7 @@ public PreparedPoint(Puntal point) { * The optimization here is that computing topology for the test geometry * is avoided. This can be significant for large geometries. */ + @Override public boolean intersects(Geometry g) { if (! envelopesIntersect(g)) return false; diff --git a/modules/core/src/main/java/org/locationtech/jts/geom/prep/PreparedPolygon.java b/modules/core/src/main/java/org/locationtech/jts/geom/prep/PreparedPolygon.java index 01c2644a04..e211db7dc8 100644 --- a/modules/core/src/main/java/org/locationtech/jts/geom/prep/PreparedPolygon.java +++ b/modules/core/src/main/java/org/locationtech/jts/geom/prep/PreparedPolygon.java @@ -74,6 +74,7 @@ public synchronized PointOnGeometryLocator getPointLocator() return pia; } + @Override public boolean intersects(Geometry g) { // envelope test @@ -87,6 +88,7 @@ public boolean intersects(Geometry g) return PreparedPolygonIntersects.intersects(this, g); } + @Override public boolean contains(Geometry g) { // short-circuit test @@ -101,6 +103,7 @@ public boolean contains(Geometry g) return PreparedPolygonContains.contains(this, g); } + @Override public boolean containsProperly(Geometry g) { // short-circuit test @@ -109,6 +112,7 @@ public boolean containsProperly(Geometry g) return PreparedPolygonContainsProperly.containsProperly(this, g); } + @Override public boolean covers(Geometry g) { // short-circuit test diff --git a/modules/core/src/main/java/org/locationtech/jts/geom/prep/PreparedPolygonContains.java b/modules/core/src/main/java/org/locationtech/jts/geom/prep/PreparedPolygonContains.java index b0a584d96a..5374c995da 100644 --- a/modules/core/src/main/java/org/locationtech/jts/geom/prep/PreparedPolygonContains.java +++ b/modules/core/src/main/java/org/locationtech/jts/geom/prep/PreparedPolygonContains.java @@ -71,6 +71,7 @@ public boolean contains(Geometry geom) * @param geom the test geometry * @return true if this prepared polygon contains the test geometry */ + @Override protected boolean fullTopologicalPredicate(Geometry geom) { boolean isContained = prepPoly.getGeometry().contains(geom); diff --git a/modules/core/src/main/java/org/locationtech/jts/geom/prep/PreparedPolygonCovers.java b/modules/core/src/main/java/org/locationtech/jts/geom/prep/PreparedPolygonCovers.java index 4615b833b4..ed87840249 100644 --- a/modules/core/src/main/java/org/locationtech/jts/geom/prep/PreparedPolygonCovers.java +++ b/modules/core/src/main/java/org/locationtech/jts/geom/prep/PreparedPolygonCovers.java @@ -71,6 +71,7 @@ public boolean covers(Geometry geom) * @param geom the test geometry * @return true if this prepared polygon covers the test geometry */ + @Override protected boolean fullTopologicalPredicate(Geometry geom) { boolean result = prepPoly.getGeometry().covers(geom); diff --git a/modules/core/src/main/java/org/locationtech/jts/geom/util/AffineTransformation.java b/modules/core/src/main/java/org/locationtech/jts/geom/util/AffineTransformation.java index a8ed63ac25..d1c3daf86c 100644 --- a/modules/core/src/main/java/org/locationtech/jts/geom/util/AffineTransformation.java +++ b/modules/core/src/main/java/org/locationtech/jts/geom/util/AffineTransformation.java @@ -1009,11 +1009,13 @@ public void transform(CoordinateSequence seq, int i) *@param seq a CoordinateSequence *@param i the index of the coordinate to transform */ + @Override public void filter(CoordinateSequence seq, int i) { transform(seq, i); } + @Override public boolean isGeometryChanged() { return true; @@ -1025,7 +1027,8 @@ public boolean isGeometryChanged() * * @return false */ - public boolean isDone() + @Override + public boolean isDone() { return false; } @@ -1110,6 +1113,7 @@ public String toString() * * @return a copy of this transformation */ + @Override public Object clone() { try { diff --git a/modules/core/src/main/java/org/locationtech/jts/geom/util/ComponentCoordinateExtracter.java b/modules/core/src/main/java/org/locationtech/jts/geom/util/ComponentCoordinateExtracter.java index 0845a51210..fe09f69c69 100644 --- a/modules/core/src/main/java/org/locationtech/jts/geom/util/ComponentCoordinateExtracter.java +++ b/modules/core/src/main/java/org/locationtech/jts/geom/util/ComponentCoordinateExtracter.java @@ -58,6 +58,7 @@ public ComponentCoordinateExtracter(List coords) this.coords = coords; } + @Override public void filter(Geometry geom) { if (geom.isEmpty()) diff --git a/modules/core/src/main/java/org/locationtech/jts/geom/util/GeometryEditor.java b/modules/core/src/main/java/org/locationtech/jts/geom/util/GeometryEditor.java index abbec9a5df..645781d1e4 100644 --- a/modules/core/src/main/java/org/locationtech/jts/geom/util/GeometryEditor.java +++ b/modules/core/src/main/java/org/locationtech/jts/geom/util/GeometryEditor.java @@ -263,6 +263,7 @@ public interface GeometryEditorOperation public static class NoOpGeometryOperation implements GeometryEditorOperation { + @Override public Geometry edit(Geometry geometry, GeometryFactory factory) { return geometry; @@ -276,6 +277,7 @@ public Geometry edit(Geometry geometry, GeometryFactory factory) public abstract static class CoordinateOperation implements GeometryEditorOperation { + @Override public final Geometry edit(Geometry geometry, GeometryFactory factory) { if (geometry instanceof LinearRing) { return factory.createLinearRing(edit(geometry.getCoordinates(), @@ -321,6 +323,7 @@ public abstract Coordinate[] edit(Coordinate[] coordinates, public abstract static class CoordinateSequenceOperation implements GeometryEditorOperation { + @Override public final Geometry edit(Geometry geometry, GeometryFactory factory) { if (geometry instanceof LinearRing) { return factory.createLinearRing(edit( diff --git a/modules/core/src/main/java/org/locationtech/jts/geom/util/GeometryExtracter.java b/modules/core/src/main/java/org/locationtech/jts/geom/util/GeometryExtracter.java index cde0cf1f6a..e4f15afc58 100644 --- a/modules/core/src/main/java/org/locationtech/jts/geom/util/GeometryExtracter.java +++ b/modules/core/src/main/java/org/locationtech/jts/geom/util/GeometryExtracter.java @@ -144,6 +144,7 @@ protected static boolean isOfType(Geometry geom, String geometryType) { return false; } + @Override public void filter(Geometry geom) { if (geometryType == null || isOfType(geom, geometryType)) comps.add(geom); diff --git a/modules/core/src/main/java/org/locationtech/jts/geom/util/LineStringExtracter.java b/modules/core/src/main/java/org/locationtech/jts/geom/util/LineStringExtracter.java index 5782a0f900..cabc7d30f9 100644 --- a/modules/core/src/main/java/org/locationtech/jts/geom/util/LineStringExtracter.java +++ b/modules/core/src/main/java/org/locationtech/jts/geom/util/LineStringExtracter.java @@ -84,6 +84,7 @@ public LineStringExtracter(List comps) this.comps = comps; } + @Override public void filter(Geometry geom) { if (geom instanceof LineString) comps.add(geom); diff --git a/modules/core/src/main/java/org/locationtech/jts/geom/util/LinearComponentExtracter.java b/modules/core/src/main/java/org/locationtech/jts/geom/util/LinearComponentExtracter.java index 2975952d30..fa1727c552 100644 --- a/modules/core/src/main/java/org/locationtech/jts/geom/util/LinearComponentExtracter.java +++ b/modules/core/src/main/java/org/locationtech/jts/geom/util/LinearComponentExtracter.java @@ -191,6 +191,7 @@ public void setForceToLineString(boolean isForcedToLineString) this.isForcedToLineString = isForcedToLineString; } + @Override public void filter(Geometry geom) { if (isForcedToLineString && geom instanceof LinearRing) { diff --git a/modules/core/src/main/java/org/locationtech/jts/geom/util/PointExtracter.java b/modules/core/src/main/java/org/locationtech/jts/geom/util/PointExtracter.java index ca0432cccb..2e6f203421 100644 --- a/modules/core/src/main/java/org/locationtech/jts/geom/util/PointExtracter.java +++ b/modules/core/src/main/java/org/locationtech/jts/geom/util/PointExtracter.java @@ -72,6 +72,7 @@ public PointExtracter(List pts) this.pts = pts; } + @Override public void filter(Geometry geom) { if (geom instanceof Point) pts.add(geom); diff --git a/modules/core/src/main/java/org/locationtech/jts/geom/util/PolygonExtracter.java b/modules/core/src/main/java/org/locationtech/jts/geom/util/PolygonExtracter.java index 686038ae1e..1a2499226e 100644 --- a/modules/core/src/main/java/org/locationtech/jts/geom/util/PolygonExtracter.java +++ b/modules/core/src/main/java/org/locationtech/jts/geom/util/PolygonExtracter.java @@ -68,6 +68,7 @@ public PolygonExtracter(List comps) this.comps = comps; } + @Override public void filter(Geometry geom) { if (geom instanceof Polygon) comps.add(geom); diff --git a/modules/core/src/main/java/org/locationtech/jts/geomgraph/DirectedEdge.java b/modules/core/src/main/java/org/locationtech/jts/geomgraph/DirectedEdge.java index 91f8307e86..29c00a0e19 100644 --- a/modules/core/src/main/java/org/locationtech/jts/geomgraph/DirectedEdge.java +++ b/modules/core/src/main/java/org/locationtech/jts/geomgraph/DirectedEdge.java @@ -71,6 +71,7 @@ public DirectedEdge(Edge edge, boolean isForward) } computeDirectedLabel(); } + @Override public Edge getEdge() { return edge; } public void setInResult(boolean isInResult) { this.isInResult = isInResult; } public boolean isInResult() { return isInResult; } @@ -217,6 +218,7 @@ public void setEdgeDepths(int position, int depth) setDepth(oppositePos, oppositeDepth); } + @Override public void print(PrintStream out) { super.print(out); diff --git a/modules/core/src/main/java/org/locationtech/jts/geomgraph/DirectedEdgeStar.java b/modules/core/src/main/java/org/locationtech/jts/geomgraph/DirectedEdgeStar.java index 37bac779f2..ed14d197e4 100644 --- a/modules/core/src/main/java/org/locationtech/jts/geomgraph/DirectedEdgeStar.java +++ b/modules/core/src/main/java/org/locationtech/jts/geomgraph/DirectedEdgeStar.java @@ -44,6 +44,7 @@ public DirectedEdgeStar() { /** * Insert a directed edge in the list */ + @Override public void insert(EdgeEnd ee) { DirectedEdge de = (DirectedEdge) ee; @@ -103,6 +104,7 @@ else if (deLast.getDy() != 0) * Compute the labelling for all dirEdges in this star, as well * as the overall labelling */ + @Override public void computeLabelling(GeometryGraph[] geom) { //Debug.print(this); @@ -372,6 +374,7 @@ private int computeDepths(int startIndex, int endIndex, int startDepth) return currDepth; } + @Override public void print(PrintStream out) { out.println("DirectedEdgeStar: " + getCoordinate()); diff --git a/modules/core/src/main/java/org/locationtech/jts/geomgraph/Edge.java b/modules/core/src/main/java/org/locationtech/jts/geomgraph/Edge.java index 8d5fd3a1a8..fa9943740e 100644 --- a/modules/core/src/main/java/org/locationtech/jts/geomgraph/Edge.java +++ b/modules/core/src/main/java/org/locationtech/jts/geomgraph/Edge.java @@ -69,6 +69,7 @@ public Coordinate getCoordinate(int i) { return pts[i]; } + @Override public Coordinate getCoordinate() { if (pts.length > 0) return pts[0]; @@ -137,6 +138,7 @@ public void setIsolated(boolean isIsolated) { this.isIsolated = isIsolated; } + @Override public boolean isIsolated() { return isIsolated; @@ -197,6 +199,7 @@ public void addIntersection(LineIntersector li, int segmentIndex, int geomIndex, * Update the IM with the contribution for this component. * A component only contributes if it has a labelling for both parent geometries */ + @Override public void computeIM(IntersectionMatrix im) { updateIM(label, im); diff --git a/modules/core/src/main/java/org/locationtech/jts/geomgraph/EdgeEnd.java b/modules/core/src/main/java/org/locationtech/jts/geomgraph/EdgeEnd.java index 136849bcfd..c3ca1ee368 100644 --- a/modules/core/src/main/java/org/locationtech/jts/geomgraph/EdgeEnd.java +++ b/modules/core/src/main/java/org/locationtech/jts/geomgraph/EdgeEnd.java @@ -74,6 +74,7 @@ protected void init(Coordinate p0, Coordinate p1) public void setNode(Node node) { this.node = node; } public Node getNode() { return node; } + @Override public int compareTo(Object obj) { EdgeEnd e = (EdgeEnd) obj; diff --git a/modules/core/src/main/java/org/locationtech/jts/geomgraph/EdgeIntersection.java b/modules/core/src/main/java/org/locationtech/jts/geomgraph/EdgeIntersection.java index d118398aae..cc89e66ec4 100644 --- a/modules/core/src/main/java/org/locationtech/jts/geomgraph/EdgeIntersection.java +++ b/modules/core/src/main/java/org/locationtech/jts/geomgraph/EdgeIntersection.java @@ -57,6 +57,7 @@ public EdgeIntersection(Coordinate coord, int segmentIndex, double dist) { public double getDistance() { return dist; } + @Override public int compareTo(Object obj) { EdgeIntersection other = (EdgeIntersection) obj; diff --git a/modules/core/src/main/java/org/locationtech/jts/geomgraph/Node.java b/modules/core/src/main/java/org/locationtech/jts/geomgraph/Node.java index 3702baba72..bb1f08bb35 100644 --- a/modules/core/src/main/java/org/locationtech/jts/geomgraph/Node.java +++ b/modules/core/src/main/java/org/locationtech/jts/geomgraph/Node.java @@ -35,6 +35,7 @@ public Node(Coordinate coord, EdgeEndStar edges) label = new Label(0, Location.NONE); } + @Override public Coordinate getCoordinate() { return coord; } public EdgeEndStar getEdges() { return edges; } @@ -56,6 +57,7 @@ public boolean isIncidentEdgeInResult() return false; } + @Override public boolean isIsolated() { return (label.getGeometryCount() == 1); @@ -63,6 +65,7 @@ public boolean isIsolated() /** * Basic nodes do not compute IMs */ + @Override protected void computeIM(IntersectionMatrix im) {} /** * Add the edge to the list of edges at this node. diff --git a/modules/core/src/main/java/org/locationtech/jts/geomgraph/index/SimpleEdgeSetIntersector.java b/modules/core/src/main/java/org/locationtech/jts/geomgraph/index/SimpleEdgeSetIntersector.java index 6bbc751ff6..7ba09a4195 100644 --- a/modules/core/src/main/java/org/locationtech/jts/geomgraph/index/SimpleEdgeSetIntersector.java +++ b/modules/core/src/main/java/org/locationtech/jts/geomgraph/index/SimpleEdgeSetIntersector.java @@ -33,6 +33,7 @@ public class SimpleEdgeSetIntersector public SimpleEdgeSetIntersector() { } + @Override public void computeIntersections(List edges, SegmentIntersector si, boolean testAllSegments) { nOverlaps = 0; @@ -48,6 +49,7 @@ public void computeIntersections(List edges, SegmentIntersector si, boolean test } + @Override public void computeIntersections(List edges0, List edges1, SegmentIntersector si) { nOverlaps = 0; diff --git a/modules/core/src/main/java/org/locationtech/jts/geomgraph/index/SimpleMCSweepLineIntersector.java b/modules/core/src/main/java/org/locationtech/jts/geomgraph/index/SimpleMCSweepLineIntersector.java index 0607e2ed15..7d673d292d 100644 --- a/modules/core/src/main/java/org/locationtech/jts/geomgraph/index/SimpleMCSweepLineIntersector.java +++ b/modules/core/src/main/java/org/locationtech/jts/geomgraph/index/SimpleMCSweepLineIntersector.java @@ -46,6 +46,7 @@ public class SimpleMCSweepLineIntersector public SimpleMCSweepLineIntersector() { } + @Override public void computeIntersections(List edges, SegmentIntersector si, boolean testAllSegments) { if (testAllSegments) @@ -55,6 +56,7 @@ public void computeIntersections(List edges, SegmentIntersector si, boolean test computeIntersections(si); } + @Override public void computeIntersections(List edges0, List edges1, SegmentIntersector si) { addEdges(edges0, edges0); diff --git a/modules/core/src/main/java/org/locationtech/jts/geomgraph/index/SimpleSweepLineIntersector.java b/modules/core/src/main/java/org/locationtech/jts/geomgraph/index/SimpleSweepLineIntersector.java index eb3b4d7405..62571c5805 100644 --- a/modules/core/src/main/java/org/locationtech/jts/geomgraph/index/SimpleSweepLineIntersector.java +++ b/modules/core/src/main/java/org/locationtech/jts/geomgraph/index/SimpleSweepLineIntersector.java @@ -41,6 +41,7 @@ public class SimpleSweepLineIntersector public SimpleSweepLineIntersector() { } + @Override public void computeIntersections(List edges, SegmentIntersector si, boolean testAllSegments) { if (testAllSegments) @@ -50,6 +51,7 @@ public void computeIntersections(List edges, SegmentIntersector si, boolean test computeIntersections(si); } + @Override public void computeIntersections(List edges0, List edges1, SegmentIntersector si) { add(edges0, edges0); diff --git a/modules/core/src/main/java/org/locationtech/jts/geomgraph/index/SweepLineEvent.java b/modules/core/src/main/java/org/locationtech/jts/geomgraph/index/SweepLineEvent.java index 5c7ece9eec..a5aaf67ccf 100644 --- a/modules/core/src/main/java/org/locationtech/jts/geomgraph/index/SweepLineEvent.java +++ b/modules/core/src/main/java/org/locationtech/jts/geomgraph/index/SweepLineEvent.java @@ -75,6 +75,7 @@ public boolean isSameLabel(SweepLineEvent ev) * items whose Insert and Delete events occur at the same x-value will be * correctly handled. */ + @Override public int compareTo(Object o) { SweepLineEvent pe = (SweepLineEvent) o; if (xValue < pe.xValue) return -1; diff --git a/modules/core/src/main/java/org/locationtech/jts/index/ArrayListVisitor.java b/modules/core/src/main/java/org/locationtech/jts/index/ArrayListVisitor.java index 2a18fefc54..6b1eebaa8a 100644 --- a/modules/core/src/main/java/org/locationtech/jts/index/ArrayListVisitor.java +++ b/modules/core/src/main/java/org/locationtech/jts/index/ArrayListVisitor.java @@ -36,6 +36,7 @@ public ArrayListVisitor() { * * @param item the item to visit */ + @Override public void visitItem(Object item) { items.add(item); diff --git a/modules/core/src/main/java/org/locationtech/jts/index/bintree/Node.java b/modules/core/src/main/java/org/locationtech/jts/index/bintree/Node.java index ed41be0c5e..617dbeb0b0 100644 --- a/modules/core/src/main/java/org/locationtech/jts/index/bintree/Node.java +++ b/modules/core/src/main/java/org/locationtech/jts/index/bintree/Node.java @@ -53,6 +53,7 @@ public Node(Interval interval, int level) public Interval getInterval() { return interval; } + @Override protected boolean isSearchMatch(Interval itemInterval) { // System.out.println(itemInterval + " overlaps " + interval + " : " diff --git a/modules/core/src/main/java/org/locationtech/jts/index/bintree/Root.java b/modules/core/src/main/java/org/locationtech/jts/index/bintree/Root.java index 087edaf93c..260c20050c 100644 --- a/modules/core/src/main/java/org/locationtech/jts/index/bintree/Root.java +++ b/modules/core/src/main/java/org/locationtech/jts/index/bintree/Root.java @@ -90,6 +90,7 @@ private void insertContained(Node tree, Interval itemInterval, Object item) /** * The root node matches all searches */ + @Override protected boolean isSearchMatch(Interval interval) { return true; diff --git a/modules/core/src/main/java/org/locationtech/jts/index/intervalrtree/IntervalRTreeBranchNode.java b/modules/core/src/main/java/org/locationtech/jts/index/intervalrtree/IntervalRTreeBranchNode.java index acc6223f51..131d623961 100644 --- a/modules/core/src/main/java/org/locationtech/jts/index/intervalrtree/IntervalRTreeBranchNode.java +++ b/modules/core/src/main/java/org/locationtech/jts/index/intervalrtree/IntervalRTreeBranchNode.java @@ -32,6 +32,7 @@ private void buildExtent(IntervalRTreeNode n1, IntervalRTreeNode n2) max = Math.max(n1.max, n2.max); } + @Override public void query(double queryMin, double queryMax, ItemVisitor visitor) { if (! intersects(queryMin, queryMax)) { diff --git a/modules/core/src/main/java/org/locationtech/jts/index/intervalrtree/IntervalRTreeLeafNode.java b/modules/core/src/main/java/org/locationtech/jts/index/intervalrtree/IntervalRTreeLeafNode.java index 4b7d3bb048..13732d44b5 100644 --- a/modules/core/src/main/java/org/locationtech/jts/index/intervalrtree/IntervalRTreeLeafNode.java +++ b/modules/core/src/main/java/org/locationtech/jts/index/intervalrtree/IntervalRTreeLeafNode.java @@ -25,6 +25,7 @@ public IntervalRTreeLeafNode(double min, double max, Object item) this.item = item; } + @Override public void query(double queryMin, double queryMax, ItemVisitor visitor) { if (! intersects(queryMin, queryMax)) diff --git a/modules/core/src/main/java/org/locationtech/jts/index/intervalrtree/IntervalRTreeNode.java b/modules/core/src/main/java/org/locationtech/jts/index/intervalrtree/IntervalRTreeNode.java index 9e5bb9f0e2..6471914ff4 100644 --- a/modules/core/src/main/java/org/locationtech/jts/index/intervalrtree/IntervalRTreeNode.java +++ b/modules/core/src/main/java/org/locationtech/jts/index/intervalrtree/IntervalRTreeNode.java @@ -43,6 +43,7 @@ public String toString() public static class NodeComparator implements Comparator { + @Override public int compare(Object o1, Object o2) { IntervalRTreeNode n1 = (IntervalRTreeNode) o1; diff --git a/modules/core/src/main/java/org/locationtech/jts/index/kdtree/KdTree.java b/modules/core/src/main/java/org/locationtech/jts/index/kdtree/KdTree.java index ad40b75f25..f4627a610f 100644 --- a/modules/core/src/main/java/org/locationtech/jts/index/kdtree/KdTree.java +++ b/modules/core/src/main/java/org/locationtech/jts/index/kdtree/KdTree.java @@ -220,6 +220,7 @@ public KdNode getNode() { return matchNode; } + @Override public void visit(KdNode node) { double dist = p.distance(node.getCoordinate()); boolean isInTolerance = dist <= tolerance; @@ -394,6 +395,7 @@ public List query(Envelope queryEnv) { public void query(Envelope queryEnv, final List result) { query(queryEnv, new KdNodeVisitor() { + @Override public void visit(KdNode node) { result.add(node); } diff --git a/modules/core/src/main/java/org/locationtech/jts/index/quadtree/Node.java b/modules/core/src/main/java/org/locationtech/jts/index/quadtree/Node.java index 9fd2f0c1d9..e7d2b96361 100644 --- a/modules/core/src/main/java/org/locationtech/jts/index/quadtree/Node.java +++ b/modules/core/src/main/java/org/locationtech/jts/index/quadtree/Node.java @@ -57,6 +57,7 @@ public Node(Envelope env, int level) public Envelope getEnvelope() { return env; } + @Override protected boolean isSearchMatch(Envelope searchEnv) { if (searchEnv == null) return false; diff --git a/modules/core/src/main/java/org/locationtech/jts/index/quadtree/Quadtree.java b/modules/core/src/main/java/org/locationtech/jts/index/quadtree/Quadtree.java index 8ac5563868..2435cfe428 100644 --- a/modules/core/src/main/java/org/locationtech/jts/index/quadtree/Quadtree.java +++ b/modules/core/src/main/java/org/locationtech/jts/index/quadtree/Quadtree.java @@ -137,6 +137,7 @@ public int size() return 0; } + @Override public void insert(Envelope itemEnv, Object item) { collectStats(itemEnv); @@ -151,6 +152,7 @@ public void insert(Envelope itemEnv, Object item) * @param item the item to remove * @return true if the item was found (and thus removed) */ + @Override public boolean remove(Envelope itemEnv, Object item) { Envelope posEnv = ensureExtent(itemEnv, minExtent); @@ -184,6 +186,7 @@ public List OLDquery(Envelope searchEnv) * @param searchEnv the envelope of the desired query area. * @return a List of items which may intersect the search envelope */ + @Override public List query(Envelope searchEnv) { /** @@ -208,6 +211,7 @@ public List query(Envelope searchEnv) * @param searchEnv the envelope of the desired query area. * @param visitor a visitor object which is passed the visited items */ + @Override public void query(Envelope searchEnv, ItemVisitor visitor) { /** diff --git a/modules/core/src/main/java/org/locationtech/jts/index/quadtree/Root.java b/modules/core/src/main/java/org/locationtech/jts/index/quadtree/Root.java index be50868932..034da507d3 100644 --- a/modules/core/src/main/java/org/locationtech/jts/index/quadtree/Root.java +++ b/modules/core/src/main/java/org/locationtech/jts/index/quadtree/Root.java @@ -89,6 +89,7 @@ private void insertContained(Node tree, Envelope itemEnv, Object item) node.add(item); } + @Override protected boolean isSearchMatch(Envelope searchEnv) { return true; diff --git a/modules/core/src/main/java/org/locationtech/jts/index/strtree/AbstractNode.java b/modules/core/src/main/java/org/locationtech/jts/index/strtree/AbstractNode.java index 71d5801962..b5dab28c7a 100644 --- a/modules/core/src/main/java/org/locationtech/jts/index/strtree/AbstractNode.java +++ b/modules/core/src/main/java/org/locationtech/jts/index/strtree/AbstractNode.java @@ -80,6 +80,7 @@ public List getChildBoundables() { * * @return the object representing bounds in this index */ + @Override public Object getBounds() { if (bounds == null) { bounds = computeBounds(); diff --git a/modules/core/src/main/java/org/locationtech/jts/index/strtree/BoundablePair.java b/modules/core/src/main/java/org/locationtech/jts/index/strtree/BoundablePair.java index 19836b7fcf..c276061460 100644 --- a/modules/core/src/main/java/org/locationtech/jts/index/strtree/BoundablePair.java +++ b/modules/core/src/main/java/org/locationtech/jts/index/strtree/BoundablePair.java @@ -110,6 +110,7 @@ private double distance() /** * Compares two pairs based on their minimum distances */ + @Override public int compareTo(Object o) { BoundablePair nd = (BoundablePair) o; diff --git a/modules/core/src/main/java/org/locationtech/jts/index/strtree/BoundablePairDistanceComparator.java b/modules/core/src/main/java/org/locationtech/jts/index/strtree/BoundablePairDistanceComparator.java index ae9c52d2a0..15096920d2 100644 --- a/modules/core/src/main/java/org/locationtech/jts/index/strtree/BoundablePairDistanceComparator.java +++ b/modules/core/src/main/java/org/locationtech/jts/index/strtree/BoundablePairDistanceComparator.java @@ -38,6 +38,7 @@ public BoundablePairDistanceComparator(boolean normalOrder) /* (non-Javadoc) * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object) */ + @Override public int compare(BoundablePair p1, BoundablePair p2) { double distance1 = p1.getDistance(); double distance2 = p2.getDistance(); diff --git a/modules/core/src/main/java/org/locationtech/jts/index/strtree/GeometryItemDistance.java b/modules/core/src/main/java/org/locationtech/jts/index/strtree/GeometryItemDistance.java index 22e9e18c8f..65a93f734f 100644 --- a/modules/core/src/main/java/org/locationtech/jts/index/strtree/GeometryItemDistance.java +++ b/modules/core/src/main/java/org/locationtech/jts/index/strtree/GeometryItemDistance.java @@ -40,6 +40,7 @@ public class GeometryItemDistance * @return the distance between the geometries * @throws ClassCastException if either item is not a Geometry */ + @Override public double distance(ItemBoundable item1, ItemBoundable item2) { if (item1 == item2) return Double.MAX_VALUE; Geometry g1 = (Geometry) item1.getItem(); diff --git a/modules/core/src/main/java/org/locationtech/jts/index/strtree/ItemBoundable.java b/modules/core/src/main/java/org/locationtech/jts/index/strtree/ItemBoundable.java index d11dbe5963..360b9582e7 100644 --- a/modules/core/src/main/java/org/locationtech/jts/index/strtree/ItemBoundable.java +++ b/modules/core/src/main/java/org/locationtech/jts/index/strtree/ItemBoundable.java @@ -28,6 +28,7 @@ public ItemBoundable(Object bounds, Object item) { this.item = item; } + @Override public Object getBounds() { return bounds; } diff --git a/modules/core/src/main/java/org/locationtech/jts/index/strtree/SIRtree.java b/modules/core/src/main/java/org/locationtech/jts/index/strtree/SIRtree.java index b843e530aa..afdfd2196c 100644 --- a/modules/core/src/main/java/org/locationtech/jts/index/strtree/SIRtree.java +++ b/modules/core/src/main/java/org/locationtech/jts/index/strtree/SIRtree.java @@ -31,6 +31,7 @@ public class SIRtree extends AbstractSTRtree { private Comparator comparator = new Comparator() { + @Override public int compare(Object o1, Object o2) { return compareDoubles( ((Interval)((Boundable)o1).getBounds()).getCentre(), @@ -39,6 +40,7 @@ public int compare(Object o1, Object o2) { }; private IntersectsOp intersectsOp = new IntersectsOp() { + @Override public boolean intersects(Object aBounds, Object bBounds) { return ((Interval)aBounds).intersects((Interval)bBounds); } @@ -57,8 +59,10 @@ public SIRtree(int nodeCapacity) { super(nodeCapacity); } + @Override protected AbstractNode createNode(int level) { return new AbstractNode(level) { + @Override protected Object computeBounds() { Interval bounds = null; for (Iterator i = getChildBoundables().iterator(); i.hasNext(); ) { @@ -97,10 +101,12 @@ public List query(double x1, double x2) { return super.query(new Interval(Math.min(x1, x2), Math.max(x1, x2))); } + @Override protected IntersectsOp getIntersectsOp() { return intersectsOp; } + @Override protected Comparator getComparator() { return comparator; } diff --git a/modules/core/src/main/java/org/locationtech/jts/index/strtree/STRtree.java b/modules/core/src/main/java/org/locationtech/jts/index/strtree/STRtree.java index d565f235b8..e068ea18a9 100644 --- a/modules/core/src/main/java/org/locationtech/jts/index/strtree/STRtree.java +++ b/modules/core/src/main/java/org/locationtech/jts/index/strtree/STRtree.java @@ -61,6 +61,7 @@ static final class STRtreeNode extends AbstractNode super(level); } + @Override protected Object computeBounds() { Envelope bounds = null; for (Iterator i = getChildBoundables().iterator(); i.hasNext(); ) { @@ -83,6 +84,7 @@ protected Object computeBounds() { private static Comparator xComparator = new Comparator() { + @Override public int compare(Object o1, Object o2) { return compareDoubles( centreX((Envelope)((Boundable)o1).getBounds()), @@ -91,6 +93,7 @@ public int compare(Object o1, Object o2) { }; private static Comparator yComparator = new Comparator() { + @Override public int compare(Object o1, Object o2) { return compareDoubles( centreY((Envelope)((Boundable)o1).getBounds()), @@ -109,6 +112,7 @@ private static double centreY(Envelope e) { private static double avg(double a, double b) { return (a + b) / 2d; } private static IntersectsOp intersectsOp = new IntersectsOp() { + @Override public boolean intersects(Object aBounds, Object bBounds) { return ((Envelope)aBounds).intersects((Envelope)bBounds); } @@ -121,6 +125,7 @@ public boolean intersects(Object aBounds, Object bBounds) { * group them into runs of size M (the node capacity). For each run, creates * a new (parent) node. */ + @Override protected List createParentBoundables(List childBoundables, int newLevel) { Assert.isTrue(!childBoundables.isEmpty()); int minLeafCount = (int) Math.ceil((childBoundables.size() / (double) getNodeCapacity())); @@ -207,10 +212,12 @@ public STRtree(int nodeCapacity, ArrayList itemBoundables) { super(nodeCapacity, itemBoundables); } + @Override protected AbstractNode createNode(int level) { return new STRtreeNode(level); } + @Override protected IntersectsOp getIntersectsOp() { return intersectsOp; } @@ -218,6 +225,7 @@ protected IntersectsOp getIntersectsOp() { /** * Inserts an item having the given bounds into the tree. */ + @Override public void insert(Envelope itemEnv, Object item) { if (itemEnv.isNull()) { return; } super.insert(itemEnv, item); @@ -226,6 +234,7 @@ public void insert(Envelope itemEnv, Object item) { /** * Returns items whose bounds intersect the given envelope. */ + @Override public List query(Envelope searchEnv) { //Yes this method does something. It specifies that the bounds is an //Envelope. super.query takes an Object, not an Envelope. [Jon Aquino 10/24/2003] @@ -235,6 +244,7 @@ public List query(Envelope searchEnv) { /** * Returns items whose bounds intersect the given envelope. */ + @Override public void query(Envelope searchEnv, ItemVisitor visitor) { //Yes this method does something. It specifies that the bounds is an //Envelope. super.query takes an Object, not an Envelope. [Jon Aquino 10/24/2003] @@ -248,6 +258,7 @@ public void query(Envelope searchEnv, ItemVisitor visitor) { * @param item the item to remove * @return true if the item was found */ + @Override public boolean remove(Envelope itemEnv, Object item) { return super.remove(itemEnv, item); } @@ -257,6 +268,7 @@ public boolean remove(Envelope itemEnv, Object item) { * * @return the number of items in the tree */ + @Override public int size() { return super.size(); @@ -267,11 +279,13 @@ public int size() * * @return the number of levels in the tree */ + @Override public int depth() { return super.depth(); } + @Override protected Comparator getComparator() { return yComparator; } diff --git a/modules/core/src/main/java/org/locationtech/jts/index/sweepline/SweepLineEvent.java b/modules/core/src/main/java/org/locationtech/jts/index/sweepline/SweepLineEvent.java index 4b26d51273..580287c777 100644 --- a/modules/core/src/main/java/org/locationtech/jts/index/sweepline/SweepLineEvent.java +++ b/modules/core/src/main/java/org/locationtech/jts/index/sweepline/SweepLineEvent.java @@ -50,6 +50,7 @@ public SweepLineEvent(double x, SweepLineEvent insertEvent, SweepLineInterval sw * items whose Insert and Delete events occur at the same x-value will be * correctly handled. */ + @Override public int compareTo(Object o) { SweepLineEvent pe = (SweepLineEvent) o; if (xValue < pe.xValue) return -1; diff --git a/modules/core/src/main/java/org/locationtech/jts/io/ByteArrayInStream.java b/modules/core/src/main/java/org/locationtech/jts/io/ByteArrayInStream.java index 6b9da54811..a38639adca 100644 --- a/modules/core/src/main/java/org/locationtech/jts/io/ByteArrayInStream.java +++ b/modules/core/src/main/java/org/locationtech/jts/io/ByteArrayInStream.java @@ -52,6 +52,7 @@ public void setBytes(final byte[] buffer) { * @param buf the buffer to place the read bytes into * @return the number of bytes read */ + @Override public int read(final byte[] buf) { int numToRead = buf.length; // don't try and copy past the end of the input diff --git a/modules/core/src/main/java/org/locationtech/jts/io/InputStreamInStream.java b/modules/core/src/main/java/org/locationtech/jts/io/InputStreamInStream.java index 66893453b0..f0924fdc1b 100644 --- a/modules/core/src/main/java/org/locationtech/jts/io/InputStreamInStream.java +++ b/modules/core/src/main/java/org/locationtech/jts/io/InputStreamInStream.java @@ -27,6 +27,7 @@ public InputStreamInStream(InputStream is) this.is = is; } + @Override public int read(byte[] buf) throws IOException { return is.read(buf); diff --git a/modules/core/src/main/java/org/locationtech/jts/io/OutputStreamOutStream.java b/modules/core/src/main/java/org/locationtech/jts/io/OutputStreamOutStream.java index 35bbe1b055..f717a4af11 100644 --- a/modules/core/src/main/java/org/locationtech/jts/io/OutputStreamOutStream.java +++ b/modules/core/src/main/java/org/locationtech/jts/io/OutputStreamOutStream.java @@ -26,6 +26,7 @@ public OutputStreamOutStream(OutputStream os) { this.os = os; } + @Override public void write(byte[] buf, int len) throws IOException { os.write(buf, 0, len); diff --git a/modules/core/src/main/java/org/locationtech/jts/io/WKTWriter.java b/modules/core/src/main/java/org/locationtech/jts/io/WKTWriter.java index 530a5686ed..4da9d64fe9 100644 --- a/modules/core/src/main/java/org/locationtech/jts/io/WKTWriter.java +++ b/modules/core/src/main/java/org/locationtech/jts/io/WKTWriter.java @@ -196,6 +196,7 @@ private CheckOrdinatesFilter(EnumSet checkOrdinateFlags) { } /** @see org.locationtech.jts.geom.CoordinateSequenceFilter#isGeometryChanged */ + @Override public void filter(CoordinateSequence seq, int i) { if (checkOrdinateFlags.contains(Ordinate.Z) && !outputOrdinates.contains(Ordinate.Z)) { @@ -210,11 +211,13 @@ public void filter(CoordinateSequence seq, int i) { } /** @see org.locationtech.jts.geom.CoordinateSequenceFilter#isGeometryChanged */ + @Override public boolean isGeometryChanged() { return false; } /** @see org.locationtech.jts.geom.CoordinateSequenceFilter#isDone */ + @Override public boolean isDone() { return outputOrdinates.equals(checkOrdinateFlags); } diff --git a/modules/core/src/main/java/org/locationtech/jts/io/gml2/GMLHandler.java b/modules/core/src/main/java/org/locationtech/jts/io/gml2/GMLHandler.java index a10a31364e..ace4e8852d 100644 --- a/modules/core/src/main/java/org/locationtech/jts/io/gml2/GMLHandler.java +++ b/modules/core/src/main/java/org/locationtech/jts/io/gml2/GMLHandler.java @@ -180,6 +180,7 @@ public Geometry getGeometry() { /** * @see org.xml.sax.helpers.DefaultHandler#characters(char[], int, int) */ + @Override public void characters(char[] ch, int start, int length) throws SAXException { if (!stack.isEmpty()) ((Handler) stack.peek()).addText(new String(ch, start, length)); @@ -188,6 +189,7 @@ public void characters(char[] ch, int start, int length) throws SAXException { /** * @see org.xml.sax.helpers.DefaultHandler#ignorableWhitespace(char[], int, int) */ + @Override public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException { if (!stack.isEmpty()) @@ -197,6 +199,7 @@ public void ignorableWhitespace(char[] ch, int start, int length) /** * @see org.xml.sax.helpers.DefaultHandler#endElement(java.lang.String, java.lang.String, java.lang.String) */ + @Override public void endElement(String uri, String localName, String qName) throws SAXException { Handler thisAction = (Handler) stack.pop(); @@ -206,6 +209,7 @@ public void endElement(String uri, String localName, String qName) /** * @see org.xml.sax.helpers.DefaultHandler#startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes) */ + @Override public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { // create a handler @@ -225,6 +229,7 @@ public void startElement(String uri, String localName, String qName, /** * @see org.xml.sax.helpers.DefaultHandler#setDocumentLocator(org.xml.sax.Locator) */ + @Override public void setDocumentLocator(Locator locator) { this.locator = locator; if (delegate instanceof ContentHandler) @@ -244,6 +249,7 @@ protected Locator getDocumentLocator() { /** * @see org.xml.sax.helpers.DefaultHandler#fatalError(org.xml.sax.SAXParseException) */ + @Override public void fatalError(SAXParseException e) throws SAXException { if (delegate != null) delegate.fatalError(e); @@ -254,6 +260,7 @@ public void fatalError(SAXParseException e) throws SAXException { /** * @see org.xml.sax.helpers.DefaultHandler#error(org.xml.sax.SAXParseException) */ + @Override public void error(SAXParseException e) throws SAXException { if (delegate != null) delegate.error(e); @@ -264,6 +271,7 @@ public void error(SAXParseException e) throws SAXException { /** * @see org.xml.sax.helpers.DefaultHandler#warning(org.xml.sax.SAXParseException) */ + @Override public void warning(SAXParseException e) throws SAXException { if (delegate != null) delegate.warning(e); diff --git a/modules/core/src/main/java/org/locationtech/jts/io/gml2/GeometryStrategies.java b/modules/core/src/main/java/org/locationtech/jts/io/gml2/GeometryStrategies.java index 55b5f56306..b102d555c0 100644 --- a/modules/core/src/main/java/org/locationtech/jts/io/gml2/GeometryStrategies.java +++ b/modules/core/src/main/java/org/locationtech/jts/io/gml2/GeometryStrategies.java @@ -69,6 +69,7 @@ private static HashMap loadStrategies(){ // point strats.put(GMLConstants.GML_POINT.toLowerCase(),new ParseStrategy(){ + @Override public Object parse(Handler arg, GeometryFactory gf) throws SAXException { // one child, either a coord // or a coordinate sequence @@ -95,6 +96,7 @@ public Object parse(Handler arg, GeometryFactory gf) throws SAXException { // linestring strats.put(GMLConstants.GML_LINESTRING.toLowerCase(),new ParseStrategy(){ + @Override public Object parse(Handler arg, GeometryFactory gf) throws SAXException { // one child, either a coord // or a coordinate sequence @@ -132,6 +134,7 @@ public Object parse(Handler arg, GeometryFactory gf) throws SAXException { // linearring strats.put(GMLConstants.GML_LINEARRING.toLowerCase(),new ParseStrategy(){ + @Override public Object parse(Handler arg, GeometryFactory gf) throws SAXException { // one child, either a coord // or a coordinate sequence @@ -169,6 +172,7 @@ public Object parse(Handler arg, GeometryFactory gf) throws SAXException { // polygon strats.put(GMLConstants.GML_POLYGON.toLowerCase(),new ParseStrategy(){ + @Override public Object parse(Handler arg, GeometryFactory gf) throws SAXException { // one child, either a coord // or a coordinate sequence @@ -194,6 +198,7 @@ public Object parse(Handler arg, GeometryFactory gf) throws SAXException { // box strats.put(GMLConstants.GML_BOX.toLowerCase(),new ParseStrategy(){ + @Override public Object parse(Handler arg, GeometryFactory gf) throws SAXException { // one child, either a coord // or a coordinate sequence @@ -218,6 +223,7 @@ public Object parse(Handler arg, GeometryFactory gf) throws SAXException { // multi-point strats.put(GMLConstants.GML_MULTI_POINT.toLowerCase(),new ParseStrategy(){ + @Override public Object parse(Handler arg, GeometryFactory gf) throws SAXException { // one child, either a coord // or a coordinate sequence @@ -241,6 +247,7 @@ public Object parse(Handler arg, GeometryFactory gf) throws SAXException { // multi-linestring strats.put(GMLConstants.GML_MULTI_LINESTRING.toLowerCase(),new ParseStrategy(){ + @Override public Object parse(Handler arg, GeometryFactory gf) throws SAXException { // one child, either a coord // or a coordinate sequence @@ -264,6 +271,7 @@ public Object parse(Handler arg, GeometryFactory gf) throws SAXException { // multi-poly strats.put(GMLConstants.GML_MULTI_POLYGON.toLowerCase(),new ParseStrategy(){ + @Override public Object parse(Handler arg, GeometryFactory gf) throws SAXException { // one child, either a coord // or a coordinate sequence @@ -287,6 +295,7 @@ public Object parse(Handler arg, GeometryFactory gf) throws SAXException { // multi-geom strats.put(GMLConstants.GML_MULTI_GEOMETRY.toLowerCase(),new ParseStrategy(){ + @Override public Object parse(Handler arg, GeometryFactory gf) throws SAXException { // one child, either a coord // or a coordinate sequence @@ -307,6 +316,7 @@ public Object parse(Handler arg, GeometryFactory gf) throws SAXException { private WeakHashMap patterns = new WeakHashMap(); + @Override public Object parse(Handler arg, GeometryFactory gf) throws SAXException { // one child, either a coord // or a coordinate sequence @@ -422,6 +432,7 @@ else if(arg.attrs.getIndex(GMLConstants.GML_NAMESPACE,"ts")>=0) // coord strats.put(GMLConstants.GML_COORD.toLowerCase(),new ParseStrategy(){ + @Override public Object parse(Handler arg, GeometryFactory gf) throws SAXException { // one child, either a coord // or a coordinate sequence @@ -445,6 +456,7 @@ public Object parse(Handler arg, GeometryFactory gf) throws SAXException { ParseStrategy coord_child = new ParseStrategy(){ + @Override public Object parse(Handler arg, GeometryFactory gf) throws SAXException { if(arg.text == null) return null; @@ -463,6 +475,7 @@ public Object parse(Handler arg, GeometryFactory gf) throws SAXException { ParseStrategy member = new ParseStrategy(){ + @Override public Object parse(Handler arg, GeometryFactory gf) throws SAXException { if(arg.children.size()!=1) throw new SAXException("Geometry Members may only contain one geometry."); diff --git a/modules/core/src/main/java/org/locationtech/jts/linearref/LinearLocation.java b/modules/core/src/main/java/org/locationtech/jts/linearref/LinearLocation.java index cbb2b45202..1014e54e49 100644 --- a/modules/core/src/main/java/org/locationtech/jts/linearref/LinearLocation.java +++ b/modules/core/src/main/java/org/locationtech/jts/linearref/LinearLocation.java @@ -319,6 +319,7 @@ public boolean isValid(Geometry linearGeom) *@return a negative integer, zero, or a positive integer as this LineStringLocation * is less than, equal to, or greater than the specified LineStringLocation */ + @Override public int compareTo(Object o) { LinearLocation other = (LinearLocation) o; // compare component indices @@ -453,6 +454,7 @@ public LinearLocation toLowest(Geometry linearGeom) * @return a copy of this location * @deprecated */ + @Override public Object clone() { return copy(); diff --git a/modules/core/src/main/java/org/locationtech/jts/math/DD.java b/modules/core/src/main/java/org/locationtech/jts/math/DD.java index d38349f3e2..9166f40a6e 100644 --- a/modules/core/src/main/java/org/locationtech/jts/math/DD.java +++ b/modules/core/src/main/java/org/locationtech/jts/math/DD.java @@ -239,6 +239,7 @@ public static DD copy(DD dd) * * @return a copy of this value */ + @Override public Object clone() { try { @@ -1033,7 +1034,8 @@ public boolean le(DD y) * @return -1,0 or 1 depending on whether this value is less than, equal to * or greater than the value of o */ - public int compareTo(Object o) + @Override + public int compareTo(Object o) { DD other = (DD) o; diff --git a/modules/core/src/main/java/org/locationtech/jts/math/Vector2D.java b/modules/core/src/main/java/org/locationtech/jts/math/Vector2D.java index 9c8bc944d6..4ba41b530e 100644 --- a/modules/core/src/main/java/org/locationtech/jts/math/Vector2D.java +++ b/modules/core/src/main/java/org/locationtech/jts/math/Vector2D.java @@ -291,6 +291,7 @@ public Coordinate toCoordinate() { * * @return a copy of this vector */ + @Override public Object clone() { return new Vector2D(this); diff --git a/modules/core/src/main/java/org/locationtech/jts/noding/BasicSegmentString.java b/modules/core/src/main/java/org/locationtech/jts/noding/BasicSegmentString.java index dc199e47ae..b7ffdc4e4c 100644 --- a/modules/core/src/main/java/org/locationtech/jts/noding/BasicSegmentString.java +++ b/modules/core/src/main/java/org/locationtech/jts/noding/BasicSegmentString.java @@ -49,6 +49,7 @@ public BasicSegmentString(Coordinate[] pts, Object data) * * @return the user-defined data */ + @Override public Object getData() { return data; } /** @@ -56,12 +57,17 @@ public BasicSegmentString(Coordinate[] pts, Object data) * * @param data an Object containing user-defined data */ + @Override public void setData(Object data) { this.data = data; } + @Override public int size() { return pts.length; } + @Override public Coordinate getCoordinate(int i) { return pts[i]; } + @Override public Coordinate[] getCoordinates() { return pts; } + @Override public boolean isClosed() { return pts[0].equals(pts[pts.length - 1]); diff --git a/modules/core/src/main/java/org/locationtech/jts/noding/InteriorIntersectionFinderAdder.java b/modules/core/src/main/java/org/locationtech/jts/noding/InteriorIntersectionFinderAdder.java index 0407ec5ea6..35dddd11ce 100644 --- a/modules/core/src/main/java/org/locationtech/jts/noding/InteriorIntersectionFinderAdder.java +++ b/modules/core/src/main/java/org/locationtech/jts/noding/InteriorIntersectionFinderAdder.java @@ -56,6 +56,7 @@ public InteriorIntersectionFinderAdder(LineIntersector li) * this call for segment pairs which they have determined do not intersect * (e.g. by an disjoint envelope test). */ + @Override public void processIntersections( SegmentString e0, int segIndex0, SegmentString e1, int segIndex1 @@ -88,6 +89,7 @@ public void processIntersections( * * @return false always */ + @Override public boolean isDone() { return false; } } diff --git a/modules/core/src/main/java/org/locationtech/jts/noding/IntersectionAdder.java b/modules/core/src/main/java/org/locationtech/jts/noding/IntersectionAdder.java index a7f1340dc0..e444a4a7e7 100644 --- a/modules/core/src/main/java/org/locationtech/jts/noding/IntersectionAdder.java +++ b/modules/core/src/main/java/org/locationtech/jts/noding/IntersectionAdder.java @@ -115,6 +115,7 @@ private boolean isTrivialIntersection(SegmentString e0, int segIndex0, SegmentSt * this call for segment pairs which they have determined do not intersect * (e.g. by an disjoint envelope test). */ + @Override public void processIntersections( SegmentString e0, int segIndex0, SegmentString e1, int segIndex1 @@ -160,5 +161,6 @@ public void processIntersections( * * @return false always */ + @Override public boolean isDone() { return false; } } diff --git a/modules/core/src/main/java/org/locationtech/jts/noding/IntersectionFinderAdder.java b/modules/core/src/main/java/org/locationtech/jts/noding/IntersectionFinderAdder.java index 2263855228..0a238512c9 100644 --- a/modules/core/src/main/java/org/locationtech/jts/noding/IntersectionFinderAdder.java +++ b/modules/core/src/main/java/org/locationtech/jts/noding/IntersectionFinderAdder.java @@ -57,6 +57,7 @@ public IntersectionFinderAdder(LineIntersector li) * this call for segment pairs which they have determined do not intersect * (e.g. by an disjoint envelope test). */ + @Override public void processIntersections( SegmentString e0, int segIndex0, SegmentString e1, int segIndex1 @@ -89,6 +90,7 @@ public void processIntersections( * * @return false always */ + @Override public boolean isDone() { return false; } } diff --git a/modules/core/src/main/java/org/locationtech/jts/noding/IteratedNoder.java b/modules/core/src/main/java/org/locationtech/jts/noding/IteratedNoder.java index 1a4f9c2322..affc3d7343 100644 --- a/modules/core/src/main/java/org/locationtech/jts/noding/IteratedNoder.java +++ b/modules/core/src/main/java/org/locationtech/jts/noding/IteratedNoder.java @@ -62,6 +62,7 @@ public void setMaximumIterations(int maxIter) this.maxIter = maxIter; } + @Override public Collection getNodedSubstrings() { return nodedSegStrings; } /** @@ -73,6 +74,7 @@ public void setMaximumIterations(int maxIter) * @param segStrings a collection of SegmentStrings to be noded * @throws TopologyException if the iterated noding fails to converge. */ + @Override public void computeNodes(Collection segStrings) throws TopologyException { diff --git a/modules/core/src/main/java/org/locationtech/jts/noding/MCIndexNoder.java b/modules/core/src/main/java/org/locationtech/jts/noding/MCIndexNoder.java index 9536abc3d5..6f81aee6a4 100644 --- a/modules/core/src/main/java/org/locationtech/jts/noding/MCIndexNoder.java +++ b/modules/core/src/main/java/org/locationtech/jts/noding/MCIndexNoder.java @@ -73,11 +73,13 @@ public MCIndexNoder(SegmentIntersector si, double overlapTolerance) public SpatialIndex getIndex() { return index; } + @Override public Collection getNodedSubstrings() { return NodedSegmentString.getNodedSubstrings(nodedSegStrings); } + @Override public void computeNodes(Collection inputSegStrings) { this.nodedSegStrings = inputSegStrings; @@ -135,6 +137,7 @@ public SegmentOverlapAction(SegmentIntersector si) this.si = si; } + @Override public void overlap(MonotoneChain mc1, int start1, MonotoneChain mc2, int start2) { SegmentString ss1 = (SegmentString) mc1.getContext(); diff --git a/modules/core/src/main/java/org/locationtech/jts/noding/MCIndexSegmentSetMutualIntersector.java b/modules/core/src/main/java/org/locationtech/jts/noding/MCIndexSegmentSetMutualIntersector.java index c5038b2dfc..f87d7ec01c 100644 --- a/modules/core/src/main/java/org/locationtech/jts/noding/MCIndexSegmentSetMutualIntersector.java +++ b/modules/core/src/main/java/org/locationtech/jts/noding/MCIndexSegmentSetMutualIntersector.java @@ -96,6 +96,7 @@ private void addToIndex(SegmentString segStr) * @param segStrings set of segments to intersect * @param segInt segment intersector to use */ + @Override public void process(Collection segStrings, SegmentIntersector segInt) { List monoChains = new ArrayList(); @@ -144,6 +145,7 @@ public SegmentOverlapAction(SegmentIntersector si) this.si = si; } + @Override public void overlap(MonotoneChain mc1, int start1, MonotoneChain mc2, int start2) { SegmentString ss1 = (SegmentString) mc1.getContext(); diff --git a/modules/core/src/main/java/org/locationtech/jts/noding/NodedSegmentString.java b/modules/core/src/main/java/org/locationtech/jts/noding/NodedSegmentString.java index 9cfb469af6..04dc699a31 100644 --- a/modules/core/src/main/java/org/locationtech/jts/noding/NodedSegmentString.java +++ b/modules/core/src/main/java/org/locationtech/jts/noding/NodedSegmentString.java @@ -98,6 +98,7 @@ public NodedSegmentString(SegmentString ss) * * @return the user-defined data */ + @Override public Object getData() { return data; } /** @@ -105,11 +106,15 @@ public NodedSegmentString(SegmentString ss) * * @param data an Object containing user-defined data */ + @Override public void setData(Object data) { this.data = data; } public SegmentNodeList getNodeList() { return nodeList; } + @Override public int size() { return pts.length; } + @Override public Coordinate getCoordinate(int i) { return pts[i]; } + @Override public Coordinate[] getCoordinates() { return pts; } /** @@ -121,6 +126,7 @@ public Coordinate[] getNodedCoordinates() { return nodeList.getSplitCoordinates(); } + @Override public boolean isClosed() { return pts[0].equals(pts[pts.length - 1]); @@ -182,6 +188,7 @@ public void addIntersection(LineIntersector li, int segmentIndex, int geomIndex, * @param intPt the location of the intersection * @param segmentIndex the index of the segment containing the intersection */ + @Override public void addIntersection(Coordinate intPt, int segmentIndex) { addIntersectionNode(intPt, segmentIndex); } diff --git a/modules/core/src/main/java/org/locationtech/jts/noding/NodingIntersectionFinder.java b/modules/core/src/main/java/org/locationtech/jts/noding/NodingIntersectionFinder.java index 35221a0277..63e2146e5e 100644 --- a/modules/core/src/main/java/org/locationtech/jts/noding/NodingIntersectionFinder.java +++ b/modules/core/src/main/java/org/locationtech/jts/noding/NodingIntersectionFinder.java @@ -245,6 +245,7 @@ public Coordinate[] getIntersectionSegments() * this call for segment pairs which they have determined do not intersect * (e.g. by an disjoint envelope test). */ + @Override public void processIntersections( SegmentString e0, int segIndex0, SegmentString e1, int segIndex1 @@ -378,6 +379,7 @@ private static boolean isEndSegment(SegmentString segStr, int index) /** * */ + @Override public boolean isDone() { if (findAllIntersections) return false; diff --git a/modules/core/src/main/java/org/locationtech/jts/noding/OrientedCoordinateArray.java b/modules/core/src/main/java/org/locationtech/jts/noding/OrientedCoordinateArray.java index 97bf2f2ec7..83cad65890 100644 --- a/modules/core/src/main/java/org/locationtech/jts/noding/OrientedCoordinateArray.java +++ b/modules/core/src/main/java/org/locationtech/jts/noding/OrientedCoordinateArray.java @@ -59,6 +59,7 @@ private static boolean orientation(Coordinate[] pts) * 1 this one is greater */ + @Override public int compareTo(Object o1) { OrientedCoordinateArray oca = (OrientedCoordinateArray) o1; int comp = compareOriented(pts, orientation, diff --git a/modules/core/src/main/java/org/locationtech/jts/noding/ScaledNoder.java b/modules/core/src/main/java/org/locationtech/jts/noding/ScaledNoder.java index d121f15369..f2bb96938e 100644 --- a/modules/core/src/main/java/org/locationtech/jts/noding/ScaledNoder.java +++ b/modules/core/src/main/java/org/locationtech/jts/noding/ScaledNoder.java @@ -56,6 +56,7 @@ public ScaledNoder(Noder noder, double scaleFactor, double offsetX, double offse public boolean isIntegerPrecision() { return scaleFactor == 1.0; } + @Override public Collection getNodedSubstrings() { Collection splitSS = noder.getNodedSubstrings(); @@ -63,6 +64,7 @@ public Collection getNodedSubstrings() return splitSS; } + @Override public void computeNodes(Collection inputSegStrings) { Collection intSegStrings = inputSegStrings; diff --git a/modules/core/src/main/java/org/locationtech/jts/noding/SegmentIntersectionDetector.java b/modules/core/src/main/java/org/locationtech/jts/noding/SegmentIntersectionDetector.java index dda4e9cb89..83ed9673b8 100644 --- a/modules/core/src/main/java/org/locationtech/jts/noding/SegmentIntersectionDetector.java +++ b/modules/core/src/main/java/org/locationtech/jts/noding/SegmentIntersectionDetector.java @@ -137,6 +137,7 @@ public Coordinate[] getIntersectionSegments() * this call for segment pairs which they have determined do not intersect * (e.g. by an disjoint envelope test). */ + @Override public void processIntersections( SegmentString e0, int segIndex0, SegmentString e1, int segIndex1 @@ -195,6 +196,7 @@ public void processIntersections( * * @return true if processing can terminate */ + @Override public boolean isDone() { /** diff --git a/modules/core/src/main/java/org/locationtech/jts/noding/SegmentNode.java b/modules/core/src/main/java/org/locationtech/jts/noding/SegmentNode.java index 577b2ffed6..a196f48721 100644 --- a/modules/core/src/main/java/org/locationtech/jts/noding/SegmentNode.java +++ b/modules/core/src/main/java/org/locationtech/jts/noding/SegmentNode.java @@ -61,6 +61,7 @@ public boolean isEndPoint(int maxSegmentIndex) * 0 this SegmentNode is at the argument location; * 1 this SegmentNode is located after the argument location */ + @Override public int compareTo(Object obj) { SegmentNode other = (SegmentNode) obj; diff --git a/modules/core/src/main/java/org/locationtech/jts/noding/SegmentNodeList.java b/modules/core/src/main/java/org/locationtech/jts/noding/SegmentNodeList.java index 271eb66015..9c16e5ad1e 100644 --- a/modules/core/src/main/java/org/locationtech/jts/noding/SegmentNodeList.java +++ b/modules/core/src/main/java/org/locationtech/jts/noding/SegmentNodeList.java @@ -333,11 +333,13 @@ class NodeVertexIterator readNextNode(); } + @Override public boolean hasNext() { if (nextNode == null) return false; return true; } + @Override public Object next() { if (currNode == null) { @@ -374,6 +376,7 @@ private void readNextNode() * *@throws UnsupportedOperationException This method is not implemented. */ + @Override public void remove() { throw new UnsupportedOperationException(getClass().getName()); } diff --git a/modules/core/src/main/java/org/locationtech/jts/noding/SimpleNoder.java b/modules/core/src/main/java/org/locationtech/jts/noding/SimpleNoder.java index 859c88adeb..fbd41ac462 100644 --- a/modules/core/src/main/java/org/locationtech/jts/noding/SimpleNoder.java +++ b/modules/core/src/main/java/org/locationtech/jts/noding/SimpleNoder.java @@ -33,11 +33,13 @@ public class SimpleNoder public SimpleNoder() { } + @Override public Collection getNodedSubstrings() { return NodedSegmentString.getNodedSubstrings(nodedSegStrings); } + @Override public void computeNodes(Collection inputSegStrings) { this.nodedSegStrings = inputSegStrings; diff --git a/modules/core/src/main/java/org/locationtech/jts/noding/SimpleSegmentSetMutualIntersector.java b/modules/core/src/main/java/org/locationtech/jts/noding/SimpleSegmentSetMutualIntersector.java index c5c37cdad7..4b1019c15f 100644 --- a/modules/core/src/main/java/org/locationtech/jts/noding/SimpleSegmentSetMutualIntersector.java +++ b/modules/core/src/main/java/org/locationtech/jts/noding/SimpleSegmentSetMutualIntersector.java @@ -46,6 +46,7 @@ public SimpleSegmentSetMutualIntersector(Collection segStrings) * @param segStrings set of segments to intersect * @param segInt segment intersector to use */ + @Override public void process(Collection segStrings, SegmentIntersector segInt) { for (Iterator i = baseSegStrings.iterator(); i.hasNext(); ) { SegmentString baseSS = (SegmentString) i.next(); diff --git a/modules/core/src/main/java/org/locationtech/jts/noding/SinglePassNoder.java b/modules/core/src/main/java/org/locationtech/jts/noding/SinglePassNoder.java index 8d89f0277b..e40b2c8e7c 100644 --- a/modules/core/src/main/java/org/locationtech/jts/noding/SinglePassNoder.java +++ b/modules/core/src/main/java/org/locationtech/jts/noding/SinglePassNoder.java @@ -56,6 +56,7 @@ public void setSegmentIntersector(SegmentIntersector segInt) * * @param segStrings a collection of {@link SegmentString}s to node */ + @Override public abstract void computeNodes(Collection segStrings); /** @@ -64,6 +65,7 @@ public void setSegmentIntersector(SegmentIntersector segInt) * * @return a Collection of SegmentStrings */ + @Override public abstract Collection getNodedSubstrings(); } diff --git a/modules/core/src/main/java/org/locationtech/jts/noding/snap/SnappingIntersectionAdder.java b/modules/core/src/main/java/org/locationtech/jts/noding/snap/SnappingIntersectionAdder.java index 694fd091a3..6f8e7efc6e 100644 --- a/modules/core/src/main/java/org/locationtech/jts/noding/snap/SnappingIntersectionAdder.java +++ b/modules/core/src/main/java/org/locationtech/jts/noding/snap/SnappingIntersectionAdder.java @@ -55,6 +55,7 @@ public SnappingIntersectionAdder(double snapTolerance, SnappingPointIndex snapPo * this call for segment pairs which they have determined do not intersect * (e.g. by an disjoint envelope test). */ + @Override public void processIntersections( SegmentString seg0, int segIndex0, SegmentString seg1, int segIndex1 @@ -165,6 +166,7 @@ private static boolean isAdjacent(SegmentString ss0, int segIndex0, SegmentStrin * * @return false always */ + @Override public boolean isDone() { return false; } } \ No newline at end of file diff --git a/modules/core/src/main/java/org/locationtech/jts/noding/snap/SnappingNoder.java b/modules/core/src/main/java/org/locationtech/jts/noding/snap/SnappingNoder.java index 9c9834ea1b..4530fbf39c 100644 --- a/modules/core/src/main/java/org/locationtech/jts/noding/snap/SnappingNoder.java +++ b/modules/core/src/main/java/org/locationtech/jts/noding/snap/SnappingNoder.java @@ -69,6 +69,7 @@ public SnappingNoder(double snapTolerance) { * * @return a Collection of NodedSegmentStrings representing the substrings */ + @Override public Collection getNodedSubstrings() { return nodedResult; @@ -79,6 +80,7 @@ public Collection getNodedSubstrings() * * @param inputSegStrings a Collection of SegmentStrings */ + @Override public void computeNodes(Collection inputSegStrings) { List snappedSS = snapVertices(inputSegStrings); diff --git a/modules/core/src/main/java/org/locationtech/jts/noding/snapround/MCIndexPointSnapper.java b/modules/core/src/main/java/org/locationtech/jts/noding/snapround/MCIndexPointSnapper.java index 043ac92640..092804559e 100644 --- a/modules/core/src/main/java/org/locationtech/jts/noding/snapround/MCIndexPointSnapper.java +++ b/modules/core/src/main/java/org/locationtech/jts/noding/snapround/MCIndexPointSnapper.java @@ -55,6 +55,7 @@ public boolean snap(HotPixel hotPixel, SegmentString parentEdge, int hotPixelVer final HotPixelSnapAction hotPixelSnapAction = new HotPixelSnapAction(hotPixel, parentEdge, hotPixelVertexIndex); index.query(pixelEnv, new ItemVisitor() { + @Override public void visitItem(Object item) { MonotoneChain testChain = (MonotoneChain) item; testChain.select(pixelEnv, hotPixelSnapAction); @@ -117,6 +118,7 @@ public HotPixelSnapAction(HotPixel hotPixel, SegmentString parentEdge, int hotPi * contain the vertex (which otherwise * would cause every vertex to be noded). */ + @Override public void select(MonotoneChain mc, int startIndex) { NodedSegmentString ss = (NodedSegmentString) mc.getContext(); diff --git a/modules/core/src/main/java/org/locationtech/jts/noding/snapround/MCIndexSnapRounder.java b/modules/core/src/main/java/org/locationtech/jts/noding/snapround/MCIndexSnapRounder.java index a27514f9ba..97b9a93021 100644 --- a/modules/core/src/main/java/org/locationtech/jts/noding/snapround/MCIndexSnapRounder.java +++ b/modules/core/src/main/java/org/locationtech/jts/noding/snapround/MCIndexSnapRounder.java @@ -63,11 +63,13 @@ public MCIndexSnapRounder(PrecisionModel pm) { scaleFactor = pm.getScale(); } + @Override public Collection getNodedSubstrings() { return NodedSegmentString.getNodedSubstrings(nodedSegStrings); } + @Override public void computeNodes(Collection inputSegmentStrings) { this.nodedSegStrings = inputSegmentStrings; diff --git a/modules/core/src/main/java/org/locationtech/jts/noding/snapround/SnapRoundingIntersectionAdder.java b/modules/core/src/main/java/org/locationtech/jts/noding/snapround/SnapRoundingIntersectionAdder.java index 22f8eba381..d530592ed2 100644 --- a/modules/core/src/main/java/org/locationtech/jts/noding/snapround/SnapRoundingIntersectionAdder.java +++ b/modules/core/src/main/java/org/locationtech/jts/noding/snapround/SnapRoundingIntersectionAdder.java @@ -83,6 +83,7 @@ public SnapRoundingIntersectionAdder(double nearnessTol) * this call for segment pairs which they have determined do not intersect * (e.g. by an disjoint envelope test). */ + @Override public void processIntersections( SegmentString e0, int segIndex0, SegmentString e1, int segIndex1 @@ -163,6 +164,7 @@ private void processNearVertex(Coordinate p, SegmentString edge, int segIndex, C * * @return false always */ + @Override public boolean isDone() { return false; } } \ No newline at end of file diff --git a/modules/core/src/main/java/org/locationtech/jts/noding/snapround/SnapRoundingNoder.java b/modules/core/src/main/java/org/locationtech/jts/noding/snapround/SnapRoundingNoder.java index 6dc3543d82..1d7750524c 100644 --- a/modules/core/src/main/java/org/locationtech/jts/noding/snapround/SnapRoundingNoder.java +++ b/modules/core/src/main/java/org/locationtech/jts/noding/snapround/SnapRoundingNoder.java @@ -77,6 +77,7 @@ public SnapRoundingNoder(PrecisionModel pm) { * @return a Collection of NodedSegmentStrings representing the substrings * */ + @Override public Collection getNodedSubstrings() { return NodedSegmentString.getNodedSubstrings(snappedResult); @@ -88,6 +89,7 @@ public Collection getNodedSubstrings() * * @param inputSegmentStrings a Collection of NodedSegmentStrings */ + @Override public void computeNodes(Collection inputSegmentStrings) { snappedResult = snapRound(inputSegmentStrings); diff --git a/modules/core/src/main/java/org/locationtech/jts/operation/buffer/BufferSubgraph.java b/modules/core/src/main/java/org/locationtech/jts/operation/buffer/BufferSubgraph.java index 5e26a61834..3b4bef2ba9 100644 --- a/modules/core/src/main/java/org/locationtech/jts/operation/buffer/BufferSubgraph.java +++ b/modules/core/src/main/java/org/locationtech/jts/operation/buffer/BufferSubgraph.java @@ -277,6 +277,7 @@ public void findResultEdges() * This relationship is used to sort the BufferSubgraphs so that shells are guaranteed to * be built before holes. */ + @Override public int compareTo(Object o) { BufferSubgraph graph = (BufferSubgraph) o; if (this.rightMostCoord.x < graph.rightMostCoord.x) { diff --git a/modules/core/src/main/java/org/locationtech/jts/operation/buffer/OffsetCurve.java b/modules/core/src/main/java/org/locationtech/jts/operation/buffer/OffsetCurve.java index 79c598af06..4a5fda3696 100644 --- a/modules/core/src/main/java/org/locationtech/jts/operation/buffer/OffsetCurve.java +++ b/modules/core/src/main/java/org/locationtech/jts/operation/buffer/OffsetCurve.java @@ -445,6 +445,7 @@ public int getBufferMinIndex() { return bufferRingMinIndex; } + @Override public void select(MonotoneChain mc, int segIndex) { /** diff --git a/modules/core/src/main/java/org/locationtech/jts/operation/buffer/SegmentMCIndex.java b/modules/core/src/main/java/org/locationtech/jts/operation/buffer/SegmentMCIndex.java index ca6a109ba7..af3926b4ac 100644 --- a/modules/core/src/main/java/org/locationtech/jts/operation/buffer/SegmentMCIndex.java +++ b/modules/core/src/main/java/org/locationtech/jts/operation/buffer/SegmentMCIndex.java @@ -46,6 +46,7 @@ private STRtree buildIndex(Coordinate[] segs) { public void query(Envelope env, MonotoneChainSelectAction action) { index.query(env, new ItemVisitor() { + @Override public void visitItem(Object item) { MonotoneChain testChain = (MonotoneChain) item; testChain.select(env, action); diff --git a/modules/core/src/main/java/org/locationtech/jts/operation/buffer/SubgraphDepthLocater.java b/modules/core/src/main/java/org/locationtech/jts/operation/buffer/SubgraphDepthLocater.java index cac9e01ab9..8ab753250d 100644 --- a/modules/core/src/main/java/org/locationtech/jts/operation/buffer/SubgraphDepthLocater.java +++ b/modules/core/src/main/java/org/locationtech/jts/operation/buffer/SubgraphDepthLocater.java @@ -185,6 +185,7 @@ public boolean isUpward() { * @param obj a DepthSegment * @return the comparison value */ + @Override public int compareTo(Object obj) { DepthSegment other = (DepthSegment) obj; diff --git a/modules/core/src/main/java/org/locationtech/jts/operation/buffer/validate/BufferCurveMaximumDistanceFinder.java b/modules/core/src/main/java/org/locationtech/jts/operation/buffer/validate/BufferCurveMaximumDistanceFinder.java index 2050569593..3a42336bcf 100644 --- a/modules/core/src/main/java/org/locationtech/jts/operation/buffer/validate/BufferCurveMaximumDistanceFinder.java +++ b/modules/core/src/main/java/org/locationtech/jts/operation/buffer/validate/BufferCurveMaximumDistanceFinder.java @@ -76,6 +76,7 @@ public MaxPointDistanceFilter(Geometry geom) { this.geom = geom; } + @Override public void filter(Coordinate pt) { minPtDist.initialize(); DistanceToPointFinder.computeDistance(geom, pt, minPtDist); @@ -98,7 +99,8 @@ public MaxMidpointDistanceFilter(Geometry geom) { this.geom = geom; } - public void filter(CoordinateSequence seq, int index) + @Override + public void filter(CoordinateSequence seq, int index) { if (index == 0) return; @@ -114,8 +116,10 @@ public void filter(CoordinateSequence seq, int index) maxPtDist.setMaximum(minPtDist); } + @Override public boolean isGeometryChanged() { return false; } + @Override public boolean isDone() { return false; } public PointPairDistance getMaxPointDistance() { diff --git a/modules/core/src/main/java/org/locationtech/jts/operation/distance/ConnectedElementLocationFilter.java b/modules/core/src/main/java/org/locationtech/jts/operation/distance/ConnectedElementLocationFilter.java index a67311faff..764956c7d1 100644 --- a/modules/core/src/main/java/org/locationtech/jts/operation/distance/ConnectedElementLocationFilter.java +++ b/modules/core/src/main/java/org/locationtech/jts/operation/distance/ConnectedElementLocationFilter.java @@ -54,6 +54,7 @@ public static List getLocations(Geometry geom) this.locations = locations; } + @Override public void filter(Geometry geom) { // empty geometries do not provide a location diff --git a/modules/core/src/main/java/org/locationtech/jts/operation/distance/ConnectedElementPointFilter.java b/modules/core/src/main/java/org/locationtech/jts/operation/distance/ConnectedElementPointFilter.java index edcc2d2b40..248e2467a5 100644 --- a/modules/core/src/main/java/org/locationtech/jts/operation/distance/ConnectedElementPointFilter.java +++ b/modules/core/src/main/java/org/locationtech/jts/operation/distance/ConnectedElementPointFilter.java @@ -51,6 +51,7 @@ public static List getCoordinates(Geometry geom) this.pts = pts; } + @Override public void filter(Geometry geom) { if (geom instanceof Point diff --git a/modules/core/src/main/java/org/locationtech/jts/operation/distance/FacetSequenceTreeBuilder.java b/modules/core/src/main/java/org/locationtech/jts/operation/distance/FacetSequenceTreeBuilder.java index 9323cdd33d..99812b8bc0 100644 --- a/modules/core/src/main/java/org/locationtech/jts/operation/distance/FacetSequenceTreeBuilder.java +++ b/modules/core/src/main/java/org/locationtech/jts/operation/distance/FacetSequenceTreeBuilder.java @@ -53,6 +53,7 @@ private static List computeFacetSequences(Geometry g) { g.apply(new GeometryComponentFilter() { + @Override public void filter(Geometry geom) { CoordinateSequence seq = null; if (geom instanceof LineString) { diff --git a/modules/core/src/main/java/org/locationtech/jts/operation/distance/IndexedFacetDistance.java b/modules/core/src/main/java/org/locationtech/jts/operation/distance/IndexedFacetDistance.java index c9a3ebaaa9..22a4395821 100644 --- a/modules/core/src/main/java/org/locationtech/jts/operation/distance/IndexedFacetDistance.java +++ b/modules/core/src/main/java/org/locationtech/jts/operation/distance/IndexedFacetDistance.java @@ -194,6 +194,7 @@ public boolean isWithinDistance(Geometry g, double maxDistance) { private static class FacetSequenceDistance implements ItemDistance { + @Override public double distance(ItemBoundable item1, ItemBoundable item2) { FacetSequence fs1 = (FacetSequence) item1.getItem(); FacetSequence fs2 = (FacetSequence) item2.getItem(); diff --git a/modules/core/src/main/java/org/locationtech/jts/operation/distance3d/AxisPlaneCoordinateSequence.java b/modules/core/src/main/java/org/locationtech/jts/operation/distance3d/AxisPlaneCoordinateSequence.java index f1fb371e07..3168beeab3 100644 --- a/modules/core/src/main/java/org/locationtech/jts/operation/distance3d/AxisPlaneCoordinateSequence.java +++ b/modules/core/src/main/java/org/locationtech/jts/operation/distance3d/AxisPlaneCoordinateSequence.java @@ -78,63 +78,77 @@ private AxisPlaneCoordinateSequence(CoordinateSequence seq, int[] indexMap) { this.indexMap = indexMap; } + @Override public int getDimension() { return 2; } + @Override public Coordinate getCoordinate(int i) { return getCoordinateCopy(i); } + @Override public Coordinate getCoordinateCopy(int i) { return new Coordinate(getX(i), getY(i), getZ(i)); } + @Override public void getCoordinate(int index, Coordinate coord) { coord.x = getOrdinate(index, X); coord.y = getOrdinate(index, Y); coord.setZ(getOrdinate(index, Z)); } + @Override public double getX(int index) { return getOrdinate(index, X); } + @Override public double getY(int index) { return getOrdinate(index, Y); } + @Override public double getZ(int index) { return getOrdinate(index, Z); } + @Override public double getOrdinate(int index, int ordinateIndex) { // Z ord is always 0 if (ordinateIndex > 1) return 0; return seq.getOrdinate(index, indexMap[ordinateIndex]); } + @Override public int size() { return seq.size(); } + @Override public void setOrdinate(int index, int ordinateIndex, double value) { throw new UnsupportedOperationException(); } + @Override public Coordinate[] toCoordinateArray() { throw new UnsupportedOperationException(); } + @Override public Envelope expandEnvelope(Envelope env) { throw new UnsupportedOperationException(); } + @Override public Object clone() { throw new UnsupportedOperationException(); } + @Override public AxisPlaneCoordinateSequence copy() { throw new UnsupportedOperationException(); diff --git a/modules/core/src/main/java/org/locationtech/jts/operation/linemerge/LineMerger.java b/modules/core/src/main/java/org/locationtech/jts/operation/linemerge/LineMerger.java index ea0cfb1fc4..415d9b6d5c 100644 --- a/modules/core/src/main/java/org/locationtech/jts/operation/linemerge/LineMerger.java +++ b/modules/core/src/main/java/org/locationtech/jts/operation/linemerge/LineMerger.java @@ -70,6 +70,7 @@ public LineMerger() */ public void add(Geometry geometry) { geometry.apply(new GeometryComponentFilter() { + @Override public void filter(Geometry component) { if (component instanceof LineString) { add((LineString)component); diff --git a/modules/core/src/main/java/org/locationtech/jts/operation/linemerge/LineSequencer.java b/modules/core/src/main/java/org/locationtech/jts/operation/linemerge/LineSequencer.java index c620aa36ce..2acb348b3d 100644 --- a/modules/core/src/main/java/org/locationtech/jts/operation/linemerge/LineSequencer.java +++ b/modules/core/src/main/java/org/locationtech/jts/operation/linemerge/LineSequencer.java @@ -165,6 +165,7 @@ public void add(Collection geometries) { */ public void add(Geometry geometry) { geometry.apply(new GeometryComponentFilter() { + @Override public void filter(Geometry component) { if (component instanceof LineString) { addLine((LineString)component); diff --git a/modules/core/src/main/java/org/locationtech/jts/operation/overlay/MaximalEdgeRing.java b/modules/core/src/main/java/org/locationtech/jts/operation/overlay/MaximalEdgeRing.java index 763dc3f40b..794c3f474f 100644 --- a/modules/core/src/main/java/org/locationtech/jts/operation/overlay/MaximalEdgeRing.java +++ b/modules/core/src/main/java/org/locationtech/jts/operation/overlay/MaximalEdgeRing.java @@ -46,10 +46,12 @@ public MaximalEdgeRing(DirectedEdge start, GeometryFactory geometryFactory) { super(start, geometryFactory); } + @Override public DirectedEdge getNext(DirectedEdge de) { return de.getNext(); } + @Override public void setEdgeRing(DirectedEdge de, EdgeRing er) { de.setEdgeRing(er); diff --git a/modules/core/src/main/java/org/locationtech/jts/operation/overlay/MinimalEdgeRing.java b/modules/core/src/main/java/org/locationtech/jts/operation/overlay/MinimalEdgeRing.java index 4c6810dd03..bc60ee57c4 100644 --- a/modules/core/src/main/java/org/locationtech/jts/operation/overlay/MinimalEdgeRing.java +++ b/modules/core/src/main/java/org/locationtech/jts/operation/overlay/MinimalEdgeRing.java @@ -32,10 +32,12 @@ public MinimalEdgeRing(DirectedEdge start, GeometryFactory geometryFactory) { super(start, geometryFactory); } + @Override public DirectedEdge getNext(DirectedEdge de) { return de.getNextMin(); } + @Override public void setEdgeRing(DirectedEdge de, EdgeRing er) { de.setMinEdgeRing(er); diff --git a/modules/core/src/main/java/org/locationtech/jts/operation/overlay/OverlayNodeFactory.java b/modules/core/src/main/java/org/locationtech/jts/operation/overlay/OverlayNodeFactory.java index f71ecc5753..ae6719074e 100644 --- a/modules/core/src/main/java/org/locationtech/jts/operation/overlay/OverlayNodeFactory.java +++ b/modules/core/src/main/java/org/locationtech/jts/operation/overlay/OverlayNodeFactory.java @@ -29,6 +29,7 @@ public class OverlayNodeFactory extends NodeFactory { + @Override public Node createNode(Coordinate coord) { return new Node(coord, new DirectedEdgeStar()); diff --git a/modules/core/src/main/java/org/locationtech/jts/operation/overlay/snap/GeometrySnapper.java b/modules/core/src/main/java/org/locationtech/jts/operation/overlay/snap/GeometrySnapper.java index 6360d930e2..cfba467da8 100644 --- a/modules/core/src/main/java/org/locationtech/jts/operation/overlay/snap/GeometrySnapper.java +++ b/modules/core/src/main/java/org/locationtech/jts/operation/overlay/snap/GeometrySnapper.java @@ -245,6 +245,7 @@ class SnapTransformer this.isSelfSnap = isSelfSnap; } + @Override protected CoordinateSequence transformCoordinates(CoordinateSequence coords, Geometry parent) { Coordinate[] srcPts = coords.toCoordinateArray(); diff --git a/modules/core/src/main/java/org/locationtech/jts/operation/overlay/validate/FuzzyPointLocator.java b/modules/core/src/main/java/org/locationtech/jts/operation/overlay/validate/FuzzyPointLocator.java index a2f9d087c6..d97ffa9430 100644 --- a/modules/core/src/main/java/org/locationtech/jts/operation/overlay/validate/FuzzyPointLocator.java +++ b/modules/core/src/main/java/org/locationtech/jts/operation/overlay/validate/FuzzyPointLocator.java @@ -121,6 +121,7 @@ public PolygonalLineworkExtracter() /** * Filters out all linework for polygonal elements */ + @Override public void filter(Geometry g) { if (g instanceof Polygon) { diff --git a/modules/core/src/main/java/org/locationtech/jts/operation/overlayng/OverlayEdge.java b/modules/core/src/main/java/org/locationtech/jts/operation/overlayng/OverlayEdge.java index 972ffd9f08..042273b121 100644 --- a/modules/core/src/main/java/org/locationtech/jts/operation/overlayng/OverlayEdge.java +++ b/modules/core/src/main/java/org/locationtech/jts/operation/overlayng/OverlayEdge.java @@ -107,6 +107,7 @@ public OverlayEdge(Coordinate orig, Coordinate dirPt, boolean direction, Overlay public boolean isForward() { return direction; } + @Override public Coordinate directionPt() { return dirPt; } diff --git a/modules/core/src/main/java/org/locationtech/jts/operation/overlayng/OverlayNGRobust.java b/modules/core/src/main/java/org/locationtech/jts/operation/overlayng/OverlayNGRobust.java index c57807007a..934c7b27eb 100644 --- a/modules/core/src/main/java/org/locationtech/jts/operation/overlayng/OverlayNGRobust.java +++ b/modules/core/src/main/java/org/locationtech/jts/operation/overlayng/OverlayNGRobust.java @@ -99,6 +99,7 @@ public static Geometry union(Collection geoms, GeometryFactory geomFac private static UnionStrategy OVERLAY_UNION = new UnionStrategy() { + @Override public Geometry union(Geometry g0, Geometry g1) { return overlay(g0, g1, OverlayNG.UNION ); } diff --git a/modules/core/src/main/java/org/locationtech/jts/operation/overlayng/UnaryUnionNG.java b/modules/core/src/main/java/org/locationtech/jts/operation/overlayng/UnaryUnionNG.java index 0a6aaee112..538a8e9f37 100644 --- a/modules/core/src/main/java/org/locationtech/jts/operation/overlayng/UnaryUnionNG.java +++ b/modules/core/src/main/java/org/locationtech/jts/operation/overlayng/UnaryUnionNG.java @@ -83,6 +83,7 @@ public static Geometry union(Collection geoms, GeometryFactory geomFac private static UnionStrategy createUnionStrategy(PrecisionModel pm) { UnionStrategy unionSRFun = new UnionStrategy() { + @Override public Geometry union(Geometry g0, Geometry g1) { return OverlayNG.overlay(g0, g1, UNION, pm); } diff --git a/modules/core/src/main/java/org/locationtech/jts/operation/polygonize/EdgeRing.java b/modules/core/src/main/java/org/locationtech/jts/operation/polygonize/EdgeRing.java index 742cc71874..33b185742e 100644 --- a/modules/core/src/main/java/org/locationtech/jts/operation/polygonize/EdgeRing.java +++ b/modules/core/src/main/java/org/locationtech/jts/operation/polygonize/EdgeRing.java @@ -474,6 +474,7 @@ public void setProcessed(boolean isProcessed) { * */ static class EnvelopeComparator implements Comparator { + @Override public int compare(EdgeRing r0, EdgeRing r1) { return r0.getRing().getEnvelope().compareTo(r1.getRing().getEnvelope()); } @@ -488,6 +489,7 @@ public int compare(EdgeRing r0, EdgeRing r1) { * */ static class EnvelopeAreaComparator implements Comparator { + @Override public int compare(EdgeRing r0, EdgeRing r1) { return Double.compare( r0.getRing().getEnvelope().getArea(), diff --git a/modules/core/src/main/java/org/locationtech/jts/operation/polygonize/Polygonizer.java b/modules/core/src/main/java/org/locationtech/jts/operation/polygonize/Polygonizer.java index 44f8bc0cab..1a8a49c34f 100644 --- a/modules/core/src/main/java/org/locationtech/jts/operation/polygonize/Polygonizer.java +++ b/modules/core/src/main/java/org/locationtech/jts/operation/polygonize/Polygonizer.java @@ -63,6 +63,7 @@ private static class LineStringAdder this.p = p; } + @Override public void filter(Geometry g) { if (g instanceof LineString) p.add((LineString) g); diff --git a/modules/core/src/main/java/org/locationtech/jts/operation/predicate/RectangleIntersects.java b/modules/core/src/main/java/org/locationtech/jts/operation/predicate/RectangleIntersects.java index 874a7f7f53..5d507d5896 100644 --- a/modules/core/src/main/java/org/locationtech/jts/operation/predicate/RectangleIntersects.java +++ b/modules/core/src/main/java/org/locationtech/jts/operation/predicate/RectangleIntersects.java @@ -145,6 +145,7 @@ public boolean intersects() return intersects; } + @Override protected void visit(Geometry element) { Envelope elementEnv = element.getEnvelopeInternal(); @@ -179,6 +180,7 @@ protected void visit(Geometry element) } } + @Override protected boolean isDone() { return intersects; @@ -219,6 +221,7 @@ public boolean containsPoint() return containsPoint; } + @Override protected void visit(Geometry geom) { // if test geometry is not polygonal this check is not needed @@ -246,6 +249,7 @@ protected void visit(Geometry geom) } } + @Override protected boolean isDone() { return containsPoint; @@ -290,6 +294,7 @@ public boolean intersects() return hasIntersection; } + @Override protected void visit(Geometry geom) { /** @@ -334,6 +339,7 @@ private void checkIntersectionWithSegments(LineString testLine) } } + @Override protected boolean isDone() { return hasIntersection; diff --git a/modules/core/src/main/java/org/locationtech/jts/operation/relate/EdgeEndBundle.java b/modules/core/src/main/java/org/locationtech/jts/operation/relate/EdgeEndBundle.java index 3580f4d2f4..b3b95af3cb 100644 --- a/modules/core/src/main/java/org/locationtech/jts/operation/relate/EdgeEndBundle.java +++ b/modules/core/src/main/java/org/locationtech/jts/operation/relate/EdgeEndBundle.java @@ -54,6 +54,7 @@ public EdgeEndBundle(EdgeEnd e) this(null, e); } + @Override public Label getLabel() { return label; } public Iterator iterator() { return edgeEnds.iterator(); } public List getEdgeEnds() { return edgeEnds; } @@ -69,6 +70,7 @@ public void insert(EdgeEnd e) * edges in this EdgeStubBundle. It essentially merges * the ON and side labels for each edge. These labels must be compatible */ + @Override public void computeLabel(BoundaryNodeRule boundaryNodeRule) { // create the label. If any of the edges belong to areas, @@ -177,6 +179,7 @@ void updateIM(IntersectionMatrix im) { Edge.updateIM(label, im); } + @Override public void print(PrintStream out) { out.println("EdgeEndBundle--> Label: " + label); diff --git a/modules/core/src/main/java/org/locationtech/jts/operation/relate/EdgeEndBundleStar.java b/modules/core/src/main/java/org/locationtech/jts/operation/relate/EdgeEndBundleStar.java index e67f624c48..a68c47dd06 100644 --- a/modules/core/src/main/java/org/locationtech/jts/operation/relate/EdgeEndBundleStar.java +++ b/modules/core/src/main/java/org/locationtech/jts/operation/relate/EdgeEndBundleStar.java @@ -40,6 +40,7 @@ public EdgeEndBundleStar() { * to contain the EdgeEnd. *
*/ + @Override public void insert(EdgeEnd e) { EdgeEndBundle eb = (EdgeEndBundle) edgeMap.get(e); diff --git a/modules/core/src/main/java/org/locationtech/jts/operation/relate/RelateNode.java b/modules/core/src/main/java/org/locationtech/jts/operation/relate/RelateNode.java index 90086c9618..45bcf40602 100644 --- a/modules/core/src/main/java/org/locationtech/jts/operation/relate/RelateNode.java +++ b/modules/core/src/main/java/org/locationtech/jts/operation/relate/RelateNode.java @@ -34,6 +34,7 @@ public RelateNode(Coordinate coord, EdgeEndStar edges) * Update the IM with the contribution for this component. * A component only contributes if it has a labelling for both parent geometries */ + @Override protected void computeIM(IntersectionMatrix im) { im.setAtLeastIfValid(label.getLocation(0), label.getLocation(1), 0); diff --git a/modules/core/src/main/java/org/locationtech/jts/operation/relate/RelateNodeFactory.java b/modules/core/src/main/java/org/locationtech/jts/operation/relate/RelateNodeFactory.java index 671a7f6fdc..eda8494e2f 100644 --- a/modules/core/src/main/java/org/locationtech/jts/operation/relate/RelateNodeFactory.java +++ b/modules/core/src/main/java/org/locationtech/jts/operation/relate/RelateNodeFactory.java @@ -24,6 +24,7 @@ public class RelateNodeFactory extends NodeFactory { + @Override public Node createNode(Coordinate coord) { return new RelateNode(coord, new EdgeEndBundleStar()); diff --git a/modules/core/src/main/java/org/locationtech/jts/operation/union/CascadedPolygonUnion.java b/modules/core/src/main/java/org/locationtech/jts/operation/union/CascadedPolygonUnion.java index 20e1fcba16..645827b7d3 100644 --- a/modules/core/src/main/java/org/locationtech/jts/operation/union/CascadedPolygonUnion.java +++ b/modules/core/src/main/java/org/locationtech/jts/operation/union/CascadedPolygonUnion.java @@ -54,6 +54,7 @@ public class CascadedPolygonUnion * with a robustness fallback to OverlayNG. */ final static UnionStrategy CLASSIC_UNION = new UnionStrategy() { + @Override public Geometry union(Geometry g0, Geometry g1) { try { return SnapIfNeededOverlayOp.union(g0, g1); diff --git a/modules/core/src/main/java/org/locationtech/jts/operation/union/OverlapUnion.java b/modules/core/src/main/java/org/locationtech/jts/operation/union/OverlapUnion.java index b4c007bfc1..1012d1b2e8 100644 --- a/modules/core/src/main/java/org/locationtech/jts/operation/union/OverlapUnion.java +++ b/modules/core/src/main/java/org/locationtech/jts/operation/union/OverlapUnion.java @@ -275,6 +275,7 @@ private static boolean containsProperly(Envelope env, Coordinate p) { private static void extractBorderSegments(Geometry geom, Envelope env, List segs) { geom.apply(new CoordinateSequenceFilter() { + @Override public void filter(CoordinateSequence seq, int i) { if (i <= 0) return; @@ -288,8 +289,10 @@ public void filter(CoordinateSequence seq, int i) { } } + @Override public boolean isDone() { return false; } + @Override public boolean isGeometryChanged() { return false; } }); diff --git a/modules/core/src/main/java/org/locationtech/jts/planargraph/DirectedEdge.java b/modules/core/src/main/java/org/locationtech/jts/planargraph/DirectedEdge.java index 7db4807ede..9497194f2b 100644 --- a/modules/core/src/main/java/org/locationtech/jts/planargraph/DirectedEdge.java +++ b/modules/core/src/main/java/org/locationtech/jts/planargraph/DirectedEdge.java @@ -147,6 +147,7 @@ void remove() { * * @return true if this directed edge is removed */ + @Override public boolean isRemoved() { return parentEdge == null; @@ -167,6 +168,7 @@ public boolean isRemoved() * function can be used to decide the relative orientation of the vectors. * */ + @Override public int compareTo(Object obj) { DirectedEdge de = (DirectedEdge) obj; diff --git a/modules/core/src/main/java/org/locationtech/jts/planargraph/Edge.java b/modules/core/src/main/java/org/locationtech/jts/planargraph/Edge.java index 968f2834c8..d392e185e1 100644 --- a/modules/core/src/main/java/org/locationtech/jts/planargraph/Edge.java +++ b/modules/core/src/main/java/org/locationtech/jts/planargraph/Edge.java @@ -111,6 +111,7 @@ void remove() { * * @return true if this edge is removed */ + @Override public boolean isRemoved() { return dirEdge == null; diff --git a/modules/core/src/main/java/org/locationtech/jts/planargraph/Node.java b/modules/core/src/main/java/org/locationtech/jts/planargraph/Node.java index ae111b778f..46a783a321 100644 --- a/modules/core/src/main/java/org/locationtech/jts/planargraph/Node.java +++ b/modules/core/src/main/java/org/locationtech/jts/planargraph/Node.java @@ -117,6 +117,7 @@ void remove() { * * @return true if this node is removed */ + @Override public boolean isRemoved() { return pt == null; diff --git a/modules/core/src/main/java/org/locationtech/jts/precision/CommonBitsRemover.java b/modules/core/src/main/java/org/locationtech/jts/precision/CommonBitsRemover.java index b01a9eb163..f3be752653 100644 --- a/modules/core/src/main/java/org/locationtech/jts/precision/CommonBitsRemover.java +++ b/modules/core/src/main/java/org/locationtech/jts/precision/CommonBitsRemover.java @@ -113,6 +113,7 @@ static class CommonCoordinateFilter private CommonBits commonBitsX = new CommonBits(); private CommonBits commonBitsY = new CommonBits(); + @Override public void filter(Coordinate coord) { commonBitsX.add(coord.x); @@ -137,6 +138,7 @@ public Translater(Coordinate trans) this.trans = trans; } + @Override public void filter(CoordinateSequence seq, int i) { double xp = seq.getOrdinate(i, 0) + trans.x; double yp = seq.getOrdinate(i, 1) + trans.y; @@ -144,10 +146,12 @@ public void filter(CoordinateSequence seq, int i) { seq.setOrdinate(i, 1, yp); } + @Override public boolean isDone() { return false; } + @Override public boolean isGeometryChanged() { return true; } diff --git a/modules/core/src/main/java/org/locationtech/jts/precision/CoordinatePrecisionReducerFilter.java b/modules/core/src/main/java/org/locationtech/jts/precision/CoordinatePrecisionReducerFilter.java index 543363fa76..df3386b740 100644 --- a/modules/core/src/main/java/org/locationtech/jts/precision/CoordinatePrecisionReducerFilter.java +++ b/modules/core/src/main/java/org/locationtech/jts/precision/CoordinatePrecisionReducerFilter.java @@ -46,6 +46,7 @@ public CoordinatePrecisionReducerFilter(PrecisionModel precModel) /** * Rounds the Coordinates in the sequence to match the PrecisionModel */ + @Override public void filter(CoordinateSequence seq, int i) { seq.setOrdinate(i, 0, precModel.makePrecise(seq.getOrdinate(i, 0))); @@ -57,6 +58,7 @@ public void filter(CoordinateSequence seq, int i) * * @return false */ + @Override public boolean isDone() { return false; } /** @@ -64,5 +66,6 @@ public void filter(CoordinateSequence seq, int i) * * @return true */ + @Override public boolean isGeometryChanged() { return true; } } diff --git a/modules/core/src/main/java/org/locationtech/jts/precision/MinimumClearance.java b/modules/core/src/main/java/org/locationtech/jts/precision/MinimumClearance.java index 82e8276f95..ade23a0417 100644 --- a/modules/core/src/main/java/org/locationtech/jts/precision/MinimumClearance.java +++ b/modules/core/src/main/java/org/locationtech/jts/precision/MinimumClearance.java @@ -236,6 +236,7 @@ public Coordinate[] getCoordinates() return minPts; } + @Override public double distance(ItemBoundable b1, ItemBoundable b2) { FacetSequence fs1 = (FacetSequence) b1.getItem(); FacetSequence fs2 = (FacetSequence) b2.getItem(); diff --git a/modules/core/src/main/java/org/locationtech/jts/precision/PointwisePrecisionReducerTransformer.java b/modules/core/src/main/java/org/locationtech/jts/precision/PointwisePrecisionReducerTransformer.java index 19cdb8333c..163251c34a 100644 --- a/modules/core/src/main/java/org/locationtech/jts/precision/PointwisePrecisionReducerTransformer.java +++ b/modules/core/src/main/java/org/locationtech/jts/precision/PointwisePrecisionReducerTransformer.java @@ -36,6 +36,7 @@ public static Geometry reduce(Geometry geom, PrecisionModel targetPM) { this.targetPM = targetPM; } + @Override protected CoordinateSequence transformCoordinates( CoordinateSequence coordinates, Geometry parent) { if (coordinates.size() == 0) diff --git a/modules/core/src/main/java/org/locationtech/jts/precision/PrecisionReducerCoordinateOperation.java b/modules/core/src/main/java/org/locationtech/jts/precision/PrecisionReducerCoordinateOperation.java index 43045c5052..41ca0e9a0d 100644 --- a/modules/core/src/main/java/org/locationtech/jts/precision/PrecisionReducerCoordinateOperation.java +++ b/modules/core/src/main/java/org/locationtech/jts/precision/PrecisionReducerCoordinateOperation.java @@ -31,6 +31,7 @@ public PrecisionReducerCoordinateOperation(PrecisionModel targetPM, boolean remo this.removeCollapsed = removeCollapsed; } + @Override public Coordinate[] edit(Coordinate[] coordinates, Geometry geom) { if (coordinates.length == 0) return null; diff --git a/modules/core/src/main/java/org/locationtech/jts/precision/PrecisionReducerTransformer.java b/modules/core/src/main/java/org/locationtech/jts/precision/PrecisionReducerTransformer.java index 5e92f9c7ec..46df489652 100644 --- a/modules/core/src/main/java/org/locationtech/jts/precision/PrecisionReducerTransformer.java +++ b/modules/core/src/main/java/org/locationtech/jts/precision/PrecisionReducerTransformer.java @@ -49,6 +49,7 @@ public static Geometry reduce(Geometry geom, PrecisionModel targetPM, boolean is this.isRemoveCollapsed = isRemoveCollapsed; } + @Override protected CoordinateSequence transformCoordinates( CoordinateSequence coordinates, Geometry parent) { if (coordinates.size() == 0) @@ -108,10 +109,12 @@ private Coordinate[] reduceCompress(CoordinateSequence coordinates) { return noRepeatCoords; } + @Override protected Geometry transformPolygon(Polygon geom, Geometry parent) { return reduceArea(geom); } + @Override protected Geometry transformMultiPolygon(MultiPolygon geom, Geometry parent) { return reduceArea(geom); } diff --git a/modules/core/src/main/java/org/locationtech/jts/precision/SimpleGeometryPrecisionReducer.java b/modules/core/src/main/java/org/locationtech/jts/precision/SimpleGeometryPrecisionReducer.java index 35faf37da1..51638c17d9 100644 --- a/modules/core/src/main/java/org/locationtech/jts/precision/SimpleGeometryPrecisionReducer.java +++ b/modules/core/src/main/java/org/locationtech/jts/precision/SimpleGeometryPrecisionReducer.java @@ -108,6 +108,7 @@ public Geometry reduce(Geometry geom) private class PrecisionReducerCoordinateOperation extends GeometryEditor.CoordinateOperation { + @Override public Coordinate[] edit(Coordinate[] coordinates, Geometry geom) { if (coordinates.length == 0) return null; diff --git a/modules/core/src/main/java/org/locationtech/jts/precision/SimpleMinimumClearance.java b/modules/core/src/main/java/org/locationtech/jts/precision/SimpleMinimumClearance.java index c567dc71fc..1bcdaf3b2a 100644 --- a/modules/core/src/main/java/org/locationtech/jts/precision/SimpleMinimumClearance.java +++ b/modules/core/src/main/java/org/locationtech/jts/precision/SimpleMinimumClearance.java @@ -109,6 +109,7 @@ public VertexCoordinateFilter(SimpleMinimumClearance smc) this.smc = smc; } + @Override public void filter(Coordinate coord) { smc.inputGeom.apply(new ComputeMCCoordinateSequenceFilter(smc, coord)); } @@ -125,6 +126,7 @@ public ComputeMCCoordinateSequenceFilter(SimpleMinimumClearance smc, Coordinate this.smc = smc; this.queryPt = queryPt; } + @Override public void filter(CoordinateSequence seq, int i) { // compare to vertex checkVertexDistance(seq.getCoordinate(i)); @@ -152,10 +154,12 @@ private void checkSegmentDistance(Coordinate seg0, Coordinate seg1) smc.updateClearance(segDist, queryPt, seg1, seg0); } + @Override public boolean isDone() { return false; } + @Override public boolean isGeometryChanged() { return false; } diff --git a/modules/core/src/main/java/org/locationtech/jts/shape/fractal/KochSnowflakeBuilder.java b/modules/core/src/main/java/org/locationtech/jts/shape/fractal/KochSnowflakeBuilder.java index 8194646114..96863dce88 100644 --- a/modules/core/src/main/java/org/locationtech/jts/shape/fractal/KochSnowflakeBuilder.java +++ b/modules/core/src/main/java/org/locationtech/jts/shape/fractal/KochSnowflakeBuilder.java @@ -37,6 +37,7 @@ public static int recursionLevelForSize(int numPts) return (int) exp; } + @Override public Geometry getGeometry() { int level = recursionLevelForSize(numPts); diff --git a/modules/core/src/main/java/org/locationtech/jts/shape/fractal/SierpinskiCarpetBuilder.java b/modules/core/src/main/java/org/locationtech/jts/shape/fractal/SierpinskiCarpetBuilder.java index b6d807221d..66235aeb7e 100644 --- a/modules/core/src/main/java/org/locationtech/jts/shape/fractal/SierpinskiCarpetBuilder.java +++ b/modules/core/src/main/java/org/locationtech/jts/shape/fractal/SierpinskiCarpetBuilder.java @@ -39,6 +39,7 @@ public static int recursionLevelForSize(int numPts) return (int) exp; } + @Override public Geometry getGeometry() { int level = recursionLevelForSize(numPts); diff --git a/modules/core/src/main/java/org/locationtech/jts/shape/random/RandomPointsBuilder.java b/modules/core/src/main/java/org/locationtech/jts/shape/random/RandomPointsBuilder.java index 04d386532e..74d3c7b612 100644 --- a/modules/core/src/main/java/org/locationtech/jts/shape/random/RandomPointsBuilder.java +++ b/modules/core/src/main/java/org/locationtech/jts/shape/random/RandomPointsBuilder.java @@ -70,6 +70,7 @@ public void setExtent(Geometry mask) extentLocator = new IndexedPointInAreaLocator(mask); } + @Override public Geometry getGeometry() { Coordinate[] pts = new Coordinate[numPts]; @@ -90,6 +91,7 @@ protected boolean isInExtent(Coordinate p) return getExtent().contains(p); } + @Override protected Coordinate createCoord(double x, double y) { Coordinate pt = new Coordinate(x, y); diff --git a/modules/core/src/main/java/org/locationtech/jts/shape/random/RandomPointsInGridBuilder.java b/modules/core/src/main/java/org/locationtech/jts/shape/random/RandomPointsInGridBuilder.java index 3a7df8a96d..ed2b4c9256 100644 --- a/modules/core/src/main/java/org/locationtech/jts/shape/random/RandomPointsInGridBuilder.java +++ b/modules/core/src/main/java/org/locationtech/jts/shape/random/RandomPointsInGridBuilder.java @@ -84,6 +84,7 @@ public void setGutterFraction(double gutterFraction) * * @return a MultiPoint */ + @Override public Geometry getGeometry() { int nCells = (int) Math.sqrt(numPts); diff --git a/modules/core/src/main/java/org/locationtech/jts/simplify/DouglasPeuckerSimplifier.java b/modules/core/src/main/java/org/locationtech/jts/simplify/DouglasPeuckerSimplifier.java index e14d0481c3..8dbf29af56 100644 --- a/modules/core/src/main/java/org/locationtech/jts/simplify/DouglasPeuckerSimplifier.java +++ b/modules/core/src/main/java/org/locationtech/jts/simplify/DouglasPeuckerSimplifier.java @@ -133,6 +133,7 @@ public DPTransformer(boolean isEnsureValidTopology, double distanceTolerance) this.distanceTolerance = distanceTolerance; } + @Override protected CoordinateSequence transformCoordinates(CoordinateSequence coords, Geometry parent) { boolean isPreserveEndpoint = ! (parent instanceof LinearRing); @@ -150,6 +151,7 @@ protected CoordinateSequence transformCoordinates(CoordinateSequence coords, Geo /** * Simplifies a polygon, fixing it if required. */ + @Override protected Geometry transformPolygon(Polygon geom, Geometry parent) { // empty geometries are simply removed if (geom.isEmpty()) @@ -169,7 +171,8 @@ protected Geometry transformPolygon(Polygon geom, Geometry parent) { * @return null if the simplification results in a degenerate ring */ //* - protected Geometry transformLinearRing(LinearRing geom, Geometry parent) + @Override + protected Geometry transformLinearRing(LinearRing geom, Geometry parent) { boolean removeDegenerateRings = parent instanceof Polygon; Geometry simpResult = super.transformLinearRing(geom, parent); @@ -182,6 +185,7 @@ protected Geometry transformLinearRing(LinearRing geom, Geometry parent) /** * Simplifies a MultiPolygon, fixing it if required. */ + @Override protected Geometry transformMultiPolygon(MultiPolygon geom, Geometry parent) { Geometry rawGeom = super.transformMultiPolygon(geom, parent); return createValidArea(rawGeom); diff --git a/modules/core/src/main/java/org/locationtech/jts/simplify/LineSegmentIndex.java b/modules/core/src/main/java/org/locationtech/jts/simplify/LineSegmentIndex.java index 23cc853ec1..5b96494923 100644 --- a/modules/core/src/main/java/org/locationtech/jts/simplify/LineSegmentIndex.java +++ b/modules/core/src/main/java/org/locationtech/jts/simplify/LineSegmentIndex.java @@ -84,6 +84,7 @@ public LineSegmentVisitor(LineSegment querySeg) { this.querySeg = querySeg; } + @Override public void visitItem(Object item) { LineSegment seg = (LineSegment) item; diff --git a/modules/core/src/main/java/org/locationtech/jts/simplify/TopologyPreservingSimplifier.java b/modules/core/src/main/java/org/locationtech/jts/simplify/TopologyPreservingSimplifier.java index eb154aafb2..8cd91912af 100644 --- a/modules/core/src/main/java/org/locationtech/jts/simplify/TopologyPreservingSimplifier.java +++ b/modules/core/src/main/java/org/locationtech/jts/simplify/TopologyPreservingSimplifier.java @@ -132,6 +132,7 @@ public LineStringTransformer(Map linestringMap) { this.linestringMap = linestringMap; } + @Override protected CoordinateSequence transformCoordinates(CoordinateSequence coords, Geometry parent) { if (coords.size() == 0) return null; @@ -170,6 +171,7 @@ static class LineStringMapBuilderFilter * * geom a geometry of any type */ + @Override public void filter(Geometry geom) { if (geom instanceof LineString) { diff --git a/modules/core/src/main/java/org/locationtech/jts/simplify/VWSimplifier.java b/modules/core/src/main/java/org/locationtech/jts/simplify/VWSimplifier.java index 005b03cc40..5568fdc0ed 100644 --- a/modules/core/src/main/java/org/locationtech/jts/simplify/VWSimplifier.java +++ b/modules/core/src/main/java/org/locationtech/jts/simplify/VWSimplifier.java @@ -136,6 +136,7 @@ public VWTransformer(boolean isEnsureValidTopology, double distanceTolerance) this.distanceTolerance = distanceTolerance; } + @Override protected CoordinateSequence transformCoordinates(CoordinateSequence coords, Geometry parent) { Coordinate[] inputPts = coords.toCoordinateArray(); @@ -152,6 +153,7 @@ protected CoordinateSequence transformCoordinates(CoordinateSequence coords, Geo /** * Simplifies a polygon, fixing it if required. */ + @Override protected Geometry transformPolygon(Polygon geom, Geometry parent) { // empty geometries are simply removed @@ -171,6 +173,7 @@ protected Geometry transformPolygon(Polygon geom, Geometry parent) * * @return null if the simplification results in a degenerate ring */ + @Override protected Geometry transformLinearRing(LinearRing geom, Geometry parent) { boolean removeDegenerateRings = parent instanceof Polygon; @@ -184,6 +187,7 @@ protected Geometry transformLinearRing(LinearRing geom, Geometry parent) /** * Simplifies a MultiPolygon, fixing it if required. */ + @Override protected Geometry transformMultiPolygon(MultiPolygon geom, Geometry parent) { Geometry rawGeom = super.transformMultiPolygon(geom, parent); diff --git a/modules/core/src/main/java/org/locationtech/jts/triangulate/MidpointSplitPointFinder.java b/modules/core/src/main/java/org/locationtech/jts/triangulate/MidpointSplitPointFinder.java index 6d1f2898de..f7d5fb9195 100644 --- a/modules/core/src/main/java/org/locationtech/jts/triangulate/MidpointSplitPointFinder.java +++ b/modules/core/src/main/java/org/locationtech/jts/triangulate/MidpointSplitPointFinder.java @@ -32,6 +32,7 @@ public class MidpointSplitPointFinder implements ConstraintSplitPointFinder { /** * Gets the midpoint of the split segment */ + @Override public Coordinate findSplitPoint(Segment seg, Coordinate encroachPt) { Coordinate p0 = seg.getStart(); Coordinate p1 = seg.getEnd(); diff --git a/modules/core/src/main/java/org/locationtech/jts/triangulate/NonEncroachingSplitPointFinder.java b/modules/core/src/main/java/org/locationtech/jts/triangulate/NonEncroachingSplitPointFinder.java index f363f1bfbc..93564e9729 100644 --- a/modules/core/src/main/java/org/locationtech/jts/triangulate/NonEncroachingSplitPointFinder.java +++ b/modules/core/src/main/java/org/locationtech/jts/triangulate/NonEncroachingSplitPointFinder.java @@ -34,6 +34,7 @@ public NonEncroachingSplitPointFinder() {} * @param encroachPt the encroaching point * @return the point at which to split the encroached segment */ + @Override public Coordinate findSplitPoint(Segment seg, Coordinate encroachPt) { LineSegment lineSeg = seg.getLineSegment(); double segLen = lineSeg.getLength(); diff --git a/modules/core/src/main/java/org/locationtech/jts/triangulate/polygon/PolygonHoleJoiner.java b/modules/core/src/main/java/org/locationtech/jts/triangulate/polygon/PolygonHoleJoiner.java index 8b6cb74957..9c0ca80e5d 100755 --- a/modules/core/src/main/java/org/locationtech/jts/triangulate/polygon/PolygonHoleJoiner.java +++ b/modules/core/src/main/java/org/locationtech/jts/triangulate/polygon/PolygonHoleJoiner.java @@ -398,6 +398,7 @@ private static List sortHoles(final Polygon poly) { } private static class EnvelopeComparator implements Comparator { + @Override public int compare(Geometry g1, Geometry g2) { Envelope e1 = g1.getEnvelopeInternal(); Envelope e2 = g2.getEnvelopeInternal(); diff --git a/modules/core/src/main/java/org/locationtech/jts/triangulate/quadedge/LastFoundQuadEdgeLocator.java b/modules/core/src/main/java/org/locationtech/jts/triangulate/quadedge/LastFoundQuadEdgeLocator.java index 907a68e492..f58280fdca 100644 --- a/modules/core/src/main/java/org/locationtech/jts/triangulate/quadedge/LastFoundQuadEdgeLocator.java +++ b/modules/core/src/main/java/org/locationtech/jts/triangulate/quadedge/LastFoundQuadEdgeLocator.java @@ -44,6 +44,7 @@ private QuadEdge findEdge() { * Locates an edge e, such that either v is on e, or e is an edge of a triangle containing v. * The search starts from the last located edge and proceeds on the general direction of v. */ + @Override public QuadEdge locate(Vertex v) { if (! lastEdge.isLive()) { init(); diff --git a/modules/core/src/main/java/org/locationtech/jts/triangulate/quadedge/QuadEdgeSubdivision.java b/modules/core/src/main/java/org/locationtech/jts/triangulate/quadedge/QuadEdgeSubdivision.java index ba98c107b4..e61543ed3c 100644 --- a/modules/core/src/main/java/org/locationtech/jts/triangulate/quadedge/QuadEdgeSubdivision.java +++ b/modules/core/src/main/java/org/locationtech/jts/triangulate/quadedge/QuadEdgeSubdivision.java @@ -648,7 +648,8 @@ private static class TriangleCircumcentreVisitor implements TriangleVisitor public TriangleCircumcentreVisitor() { } - public void visit(QuadEdge[] triEdges) + @Override + public void visit(QuadEdge[] triEdges) { Coordinate a = triEdges[0].orig().getCoordinate(); Coordinate b = triEdges[1].orig().getCoordinate(); @@ -754,6 +755,7 @@ public List getTriangleEdges(boolean includeFrame) { private static class TriangleEdgesListVisitor implements TriangleVisitor { private List triList = new ArrayList(); + @Override public void visit(QuadEdge[] triEdges) { triList.add(new QuadEdge[]{triEdges[0], triEdges[1], triEdges[2]}); } @@ -780,6 +782,7 @@ public List getTriangleVertices(boolean includeFrame) { private static class TriangleVertexListVisitor implements TriangleVisitor { private List triList = new ArrayList(); + @Override public void visit(QuadEdge[] triEdges) { triList.add(new Vertex[] { triEdges[0].orig(), triEdges[1].orig(), triEdges[2].orig() }); @@ -811,6 +814,7 @@ private static class TriangleCoordinatesVisitor implements TriangleVisitor { public TriangleCoordinatesVisitor() { } + @Override public void visit(QuadEdge[] triEdges) { coordList.clear(); for (int i = 0; i < 3; i++) { diff --git a/modules/core/src/main/java/org/locationtech/jts/triangulate/quadedge/QuadEdgeTriangle.java b/modules/core/src/main/java/org/locationtech/jts/triangulate/quadedge/QuadEdgeTriangle.java index 80189246c7..ad559c354f 100644 --- a/modules/core/src/main/java/org/locationtech/jts/triangulate/quadedge/QuadEdgeTriangle.java +++ b/modules/core/src/main/java/org/locationtech/jts/triangulate/quadedge/QuadEdgeTriangle.java @@ -327,6 +327,7 @@ private static class QuadEdgeTriangleBuilderVisitor implements TriangleVisitor { public QuadEdgeTriangleBuilderVisitor() { } + @Override public void visit(QuadEdge[] edges) { triangles.add(new QuadEdgeTriangle(edges)); } diff --git a/modules/core/src/main/java/org/locationtech/jts/util/CoordinateArrayFilter.java b/modules/core/src/main/java/org/locationtech/jts/util/CoordinateArrayFilter.java index 07d60a1335..dc95727982 100644 --- a/modules/core/src/main/java/org/locationtech/jts/util/CoordinateArrayFilter.java +++ b/modules/core/src/main/java/org/locationtech/jts/util/CoordinateArrayFilter.java @@ -44,6 +44,7 @@ public Coordinate[] getCoordinates() { return pts; } + @Override public void filter(Coordinate coord) { pts[n++] = coord; } diff --git a/modules/core/src/main/java/org/locationtech/jts/util/CoordinateCountFilter.java b/modules/core/src/main/java/org/locationtech/jts/util/CoordinateCountFilter.java index d09e8c8709..50d3ac330c 100644 --- a/modules/core/src/main/java/org/locationtech/jts/util/CoordinateCountFilter.java +++ b/modules/core/src/main/java/org/locationtech/jts/util/CoordinateCountFilter.java @@ -34,6 +34,7 @@ public int getCount() { return n; } + @Override public void filter(Coordinate coord) { n++; } diff --git a/modules/core/src/main/java/org/locationtech/jts/util/Debug.java b/modules/core/src/main/java/org/locationtech/jts/util/Debug.java index 44483ac4ed..ee522751fc 100644 --- a/modules/core/src/main/java/org/locationtech/jts/util/Debug.java +++ b/modules/core/src/main/java/org/locationtech/jts/util/Debug.java @@ -230,6 +230,7 @@ public SegmentFindingFilter(Coordinate p0, Coordinate p1) public boolean hasSegment() { return hasSegment; } + @Override public void filter(CoordinateSequence seq, int i) { if (i == 0) return; @@ -237,11 +238,13 @@ public void filter(CoordinateSequence seq, int i) && p1.equals2D(seq.getCoordinate(i)); } + @Override public boolean isDone() { return hasSegment; } + @Override public boolean isGeometryChanged() { return false; diff --git a/modules/core/src/main/java/org/locationtech/jts/util/UniqueCoordinateArrayFilter.java b/modules/core/src/main/java/org/locationtech/jts/util/UniqueCoordinateArrayFilter.java index 1dc1d5b276..2ac639f053 100644 --- a/modules/core/src/main/java/org/locationtech/jts/util/UniqueCoordinateArrayFilter.java +++ b/modules/core/src/main/java/org/locationtech/jts/util/UniqueCoordinateArrayFilter.java @@ -63,6 +63,7 @@ public Coordinate[] getCoordinates() { /** * @see CoordinateFilter#filter(Coordinate) */ + @Override public void filter(Coordinate coord) { if (coordSet.add(coord)) { list.add(coord); diff --git a/modules/core/src/test/java/org/locationtech/jts/algorithm/ConvexHullTest.java b/modules/core/src/test/java/org/locationtech/jts/algorithm/ConvexHullTest.java index 44cca5496a..fb51d330d7 100644 --- a/modules/core/src/test/java/org/locationtech/jts/algorithm/ConvexHullTest.java +++ b/modules/core/src/test/java/org/locationtech/jts/algorithm/ConvexHullTest.java @@ -184,6 +184,7 @@ private static class ConvexHullEx extends ConvexHull { public ConvexHullEx(Geometry geometry) { super(geometry); } + @Override protected Coordinate[] toCoordinateArray(Stack stack) { return super.toCoordinateArray(stack); } diff --git a/modules/core/src/test/java/org/locationtech/jts/algorithm/LocatePointInRingTest.java b/modules/core/src/test/java/org/locationtech/jts/algorithm/LocatePointInRingTest.java index 8f8566c14b..db5abeb905 100644 --- a/modules/core/src/test/java/org/locationtech/jts/algorithm/LocatePointInRingTest.java +++ b/modules/core/src/test/java/org/locationtech/jts/algorithm/LocatePointInRingTest.java @@ -32,6 +32,7 @@ public static void main(String args[]) { public LocatePointInRingTest(String name) { super(name); } + @Override protected void runPtInRing(int expectedLoc, Coordinate pt, String wkt) throws Exception { diff --git a/modules/core/src/test/java/org/locationtech/jts/algorithm/NonRobustLineIntersector.java b/modules/core/src/test/java/org/locationtech/jts/algorithm/NonRobustLineIntersector.java index e8e4eab667..17722b602a 100644 --- a/modules/core/src/test/java/org/locationtech/jts/algorithm/NonRobustLineIntersector.java +++ b/modules/core/src/test/java/org/locationtech/jts/algorithm/NonRobustLineIntersector.java @@ -40,6 +40,7 @@ public static boolean isSameSignAndNonZero(double a, double b) { public NonRobustLineIntersector() { } + @Override public void computeIntersection( Coordinate p, Coordinate p1, @@ -90,6 +91,7 @@ public void computeIntersection( result = POINT_INTERSECTION; } + @Override protected int computeIntersect( Coordinate p1, Coordinate p2, diff --git a/modules/core/src/test/java/org/locationtech/jts/algorithm/PointInRingTest.java b/modules/core/src/test/java/org/locationtech/jts/algorithm/PointInRingTest.java index ea4a7b71bc..8f73d864fb 100644 --- a/modules/core/src/test/java/org/locationtech/jts/algorithm/PointInRingTest.java +++ b/modules/core/src/test/java/org/locationtech/jts/algorithm/PointInRingTest.java @@ -34,6 +34,7 @@ public static void main(String args[]) { public PointInRingTest(String name) { super(name); } + @Override protected void runPtInRing(int expectedLoc, Coordinate pt, String wkt) throws Exception { diff --git a/modules/core/src/test/java/org/locationtech/jts/algorithm/RayCrossingCounterTest.java b/modules/core/src/test/java/org/locationtech/jts/algorithm/RayCrossingCounterTest.java index 2940c55511..b9ebdb3204 100644 --- a/modules/core/src/test/java/org/locationtech/jts/algorithm/RayCrossingCounterTest.java +++ b/modules/core/src/test/java/org/locationtech/jts/algorithm/RayCrossingCounterTest.java @@ -36,6 +36,7 @@ public static void main(String args[]) { public RayCrossingCounterTest(String name) { super(name); } + @Override protected void runPtInRing(int expectedLoc, Coordinate pt, String wkt) throws Exception { diff --git a/modules/core/src/test/java/org/locationtech/jts/algorithm/locate/IndexedPointInAreaLocatorTest.java b/modules/core/src/test/java/org/locationtech/jts/algorithm/locate/IndexedPointInAreaLocatorTest.java index 506dfb2d57..55f2bfae3d 100644 --- a/modules/core/src/test/java/org/locationtech/jts/algorithm/locate/IndexedPointInAreaLocatorTest.java +++ b/modules/core/src/test/java/org/locationtech/jts/algorithm/locate/IndexedPointInAreaLocatorTest.java @@ -35,6 +35,7 @@ public static void main(String args[]) { public IndexedPointInAreaLocatorTest(String name) { super(name); } + @Override protected void runPtInRing(int expectedLoc, Coordinate pt, String wkt) throws Exception { diff --git a/modules/core/src/test/java/org/locationtech/jts/algorithm/locate/SimplePointInAreaLocatorTest.java b/modules/core/src/test/java/org/locationtech/jts/algorithm/locate/SimplePointInAreaLocatorTest.java index c8f7bf3e62..a8d6c29af0 100644 --- a/modules/core/src/test/java/org/locationtech/jts/algorithm/locate/SimplePointInAreaLocatorTest.java +++ b/modules/core/src/test/java/org/locationtech/jts/algorithm/locate/SimplePointInAreaLocatorTest.java @@ -34,6 +34,7 @@ public static void main(String args[]) { public SimplePointInAreaLocatorTest(String name) { super(name); } + @Override protected void runPtInRing(int expectedLoc, Coordinate pt, String wkt) throws Exception { diff --git a/modules/core/src/test/java/org/locationtech/jts/generator/GridGenerator.java b/modules/core/src/test/java/org/locationtech/jts/generator/GridGenerator.java index 09cb710632..67558a1312 100644 --- a/modules/core/src/test/java/org/locationtech/jts/generator/GridGenerator.java +++ b/modules/core/src/test/java/org/locationtech/jts/generator/GridGenerator.java @@ -49,6 +49,7 @@ public GridGenerator(){ * @throws NoSuchElementException when all the grids have been created (@see #create()) * @throws NullPointerException when either the Geometry Factory, or the Bounding Box are undefined. */ + @Override public Geometry create() { return geometryFactory.toGeometry(createEnv()); } @@ -115,6 +116,7 @@ public void reset(){ /** * @see org.locationtech.jts.generator.GeometryGenerator#setDimensions(int) */ + @Override public void setDimensions(int dimensions) { if(dimensions!=2) throw new IllegalStateException("MAY NOT CHANGE GridGenerator's Dimensions"); diff --git a/modules/core/src/test/java/org/locationtech/jts/generator/LineStringGenerator.java b/modules/core/src/test/java/org/locationtech/jts/generator/LineStringGenerator.java index 53f6ac2f95..1c08bcecf5 100644 --- a/modules/core/src/test/java/org/locationtech/jts/generator/LineStringGenerator.java +++ b/modules/core/src/test/java/org/locationtech/jts/generator/LineStringGenerator.java @@ -74,6 +74,7 @@ public class LineStringGenerator extends GeometryGenerator { * @throws IllegalStateException When the alg is not valid or the number of points is invalid * @throws NullPointerException when either the Geometry Factory, or the Bounding Box are undefined. */ + @Override public Geometry create() { if(geometryFactory == null){ diff --git a/modules/core/src/test/java/org/locationtech/jts/generator/MultiGenerator.java b/modules/core/src/test/java/org/locationtech/jts/generator/MultiGenerator.java index d4da336f74..6908054ff6 100644 --- a/modules/core/src/test/java/org/locationtech/jts/generator/MultiGenerator.java +++ b/modules/core/src/test/java/org/locationtech/jts/generator/MultiGenerator.java @@ -67,6 +67,7 @@ public MultiGenerator(GeometryGenerator generator) { * @throws IllegalStateException when the number of child geoms is too small * @throws IllegalStateException when the selected alg. is invalid */ + @Override public Geometry create() { if(generator == null) throw new NullPointerException("Missing child generator"); @@ -149,6 +150,7 @@ public GeometryGenerator getGenerator() { /** * @see org.locationtech.jts.generator.GeometryGenerator#setBoundingBox(org.locationtech.jts.geom.Envelope) */ + @Override public void setBoundingBox(Envelope boundingBox) { super.setBoundingBox(boundingBox); if(generator!=null) @@ -158,6 +160,7 @@ public void setBoundingBox(Envelope boundingBox) { /** * @see org.locationtech.jts.generator.GeometryGenerator#setDimensions(int) */ + @Override public void setDimensions(int dimensions) { super.setDimensions(dimensions); if(generator!=null) @@ -167,6 +170,7 @@ public void setDimensions(int dimensions) { /** * @see org.locationtech.jts.generator.GeometryGenerator#setGeometryFactory(org.locationtech.jts.geom.GeometryFactory) */ + @Override public void setGeometryFactory(GeometryFactory geometryFactory) { super.setGeometryFactory(geometryFactory); if(generator!=null) diff --git a/modules/core/src/test/java/org/locationtech/jts/generator/PointGenerator.java b/modules/core/src/test/java/org/locationtech/jts/generator/PointGenerator.java index c4ab1d3006..bbc293936a 100644 --- a/modules/core/src/test/java/org/locationtech/jts/generator/PointGenerator.java +++ b/modules/core/src/test/java/org/locationtech/jts/generator/PointGenerator.java @@ -28,6 +28,7 @@ public class PointGenerator extends GeometryGenerator { * @see org.locationtech.jts.generator.GeometryGenerator#create() * @throws NullPointerException when either the Geometry Factory, or the Bounding Box are undefined. */ + @Override public Geometry create() { if(geometryFactory == null){ throw new NullPointerException("GeometryFactory is not declared"); diff --git a/modules/core/src/test/java/org/locationtech/jts/generator/PolygonGenerator.java b/modules/core/src/test/java/org/locationtech/jts/generator/PolygonGenerator.java index d7af81d564..cbadb89bb9 100644 --- a/modules/core/src/test/java/org/locationtech/jts/generator/PolygonGenerator.java +++ b/modules/core/src/test/java/org/locationtech/jts/generator/PolygonGenerator.java @@ -62,6 +62,7 @@ public class PolygonGenerator extends GeometryGenerator { * @throws IllegalStateException When the alg is not valid or the number of points is invalid * @throws NullPointerException when either the Geometry Factory, or the Bounding Box are undefined. */ + @Override public Geometry create() { if(geometryFactory == null){ diff --git a/modules/core/src/test/java/org/locationtech/jts/geom/GeometryImplTest.java b/modules/core/src/test/java/org/locationtech/jts/geom/GeometryImplTest.java index 27ccdbbfdd..80859db695 100644 --- a/modules/core/src/test/java/org/locationtech/jts/geom/GeometryImplTest.java +++ b/modules/core/src/test/java/org/locationtech/jts/geom/GeometryImplTest.java @@ -150,6 +150,7 @@ public void testInvalidateEnvelope() throws Exception { Geometry g = reader.read("POLYGON ((0 0, 0 50, 50 50, 50 0, 0 0))"); assertEquals(new Envelope(0, 50, 0, 50), g.getEnvelopeInternal()); g.apply(new CoordinateFilter() { + @Override public void filter(Coordinate coord) { coord.x += 1; coord.y += 1; @@ -200,6 +201,7 @@ public void testEqualsExactForLinearRings() throws Exception { LinearRing sameClassButEmpty = geometryFactory.createLinearRing((CoordinateSequence)null); LinearRing anotherSameClassButEmpty = geometryFactory.createLinearRing((CoordinateSequence)null); CollectionFactory collectionFactory = new CollectionFactory() { + @Override public Geometry createCollection(Geometry[] geometries) { return geometryFactory.createMultiLineString(GeometryFactory.toLineStringArray( Arrays.asList(geometries))); @@ -234,6 +236,7 @@ public void testEqualsExactForLineStrings() throws Exception { LineString sameClassButEmpty = geometryFactory.createLineString((Coordinate[])null); LineString anotherSameClassButEmpty = geometryFactory.createLineString((Coordinate[])null); CollectionFactory collectionFactory = new CollectionFactory() { + @Override public Geometry createCollection(Geometry[] geometries) { return geometryFactory.createMultiLineString(GeometryFactory.toLineStringArray( Arrays.asList(geometries))); @@ -245,6 +248,7 @@ public Geometry createCollection(Geometry[] geometries) { anotherSameClassButEmpty, collectionFactory); CollectionFactory collectionFactory2 = new CollectionFactory() { + @Override public Geometry createCollection(Geometry[] geometries) { return geometryFactory.createMultiLineString(GeometryFactory.toLineStringArray( Arrays.asList(geometries))); @@ -265,6 +269,7 @@ public void testEqualsExactForPoints() throws Exception { Point sameClassButEmpty = geometryFactory.createPoint((Coordinate)null); Point anotherSameClassButEmpty = geometryFactory.createPoint((Coordinate)null); CollectionFactory collectionFactory = new CollectionFactory() { + @Override public Geometry createCollection(Geometry[] geometries) { return geometryFactory.createMultiPoint(GeometryFactory.toPointArray( Arrays.asList(geometries))); @@ -287,6 +292,7 @@ public void testEqualsExactForPolygons() throws Exception { Polygon anotherSameClassButEmpty = (Polygon) reader.read( "POLYGON EMPTY"); CollectionFactory collectionFactory = new CollectionFactory() { + @Override public Geometry createCollection(Geometry[] geometries) { return geometryFactory.createMultiPolygon(GeometryFactory.toPolygonArray( Arrays.asList(geometries))); @@ -316,6 +322,7 @@ public void testEqualsExactForGeometryCollections() GeometryCollection sameClassButEmpty = geometryFactory.createGeometryCollection(null); GeometryCollection anotherSameClassButEmpty = geometryFactory.createGeometryCollection(null); CollectionFactory collectionFactory = new CollectionFactory() { + @Override public Geometry createCollection(Geometry[] geometries) { return geometryFactory.createGeometryCollection(geometries); } diff --git a/modules/core/src/test/java/org/locationtech/jts/geom/GeometryOpGCUnsupportedTest.java b/modules/core/src/test/java/org/locationtech/jts/geom/GeometryOpGCUnsupportedTest.java index 6fd4e82f79..0bb15d7cbf 100644 --- a/modules/core/src/test/java/org/locationtech/jts/geom/GeometryOpGCUnsupportedTest.java +++ b/modules/core/src/test/java/org/locationtech/jts/geom/GeometryOpGCUnsupportedTest.java @@ -19,7 +19,7 @@ public void testBoundary() { final Geometry a = read(WKT_GC); final Geometry b = read(WKT_POLY); - (new FailureChecker() { void operation() { + (new FailureChecker() { @Override void operation() { a.getBoundary(); } }).check(IllegalArgumentException.class); @@ -29,11 +29,11 @@ public void testRelate() { final Geometry a = read(WKT_GC); final Geometry b = read(WKT_POLY); - (new FailureChecker() { void operation() { + (new FailureChecker() { @Override void operation() { a.relate(b); } }).check(IllegalArgumentException.class); - (new FailureChecker() { void operation() { + (new FailureChecker() { @Override void operation() { b.relate(a); } }).check(IllegalArgumentException.class); @@ -43,11 +43,11 @@ public void testUnion() { final Geometry a = read(WKT_GC); final Geometry b = read(WKT_POLY); - (new FailureChecker() { void operation() { + (new FailureChecker() { @Override void operation() { a.union(b); } }).check(IllegalArgumentException.class); - (new FailureChecker() { void operation() { + (new FailureChecker() { @Override void operation() { b.union(a); } }).check(IllegalArgumentException.class); } @@ -56,11 +56,11 @@ public void testDifference() { final Geometry a = read(WKT_GC); final Geometry b = read(WKT_POLY); - (new FailureChecker() { void operation() { + (new FailureChecker() { @Override void operation() { a.difference(b); } }).check(IllegalArgumentException.class); - (new FailureChecker() { void operation() { + (new FailureChecker() { @Override void operation() { b.difference(a); } }).check(IllegalArgumentException.class); } @@ -69,11 +69,11 @@ public void testSymDifference() { final Geometry a = read(WKT_GC); final Geometry b = read(WKT_POLY); - (new FailureChecker() { void operation() { + (new FailureChecker() { @Override void operation() { a.symDifference(b); } }).check(IllegalArgumentException.class); - (new FailureChecker() { void operation() { + (new FailureChecker() { @Override void operation() { b.symDifference(a); } }).check(IllegalArgumentException.class); } diff --git a/modules/core/src/test/java/org/locationtech/jts/geom/prep/PreparedPolygonPredicateStressTest.java b/modules/core/src/test/java/org/locationtech/jts/geom/prep/PreparedPolygonPredicateStressTest.java index 978868591e..9170f0b0e3 100644 --- a/modules/core/src/test/java/org/locationtech/jts/geom/prep/PreparedPolygonPredicateStressTest.java +++ b/modules/core/src/test/java/org/locationtech/jts/geom/prep/PreparedPolygonPredicateStressTest.java @@ -49,6 +49,7 @@ public void test() class PredicateStressTester extends StressTestHarness { + @Override public boolean checkResult(Geometry target, Geometry test) { if (! checkIntersects(target, test)) return false; if (! checkContains(target, test)) return false; diff --git a/modules/core/src/test/java/org/locationtech/jts/index/hprtree/HPRtreeTest.java b/modules/core/src/test/java/org/locationtech/jts/index/hprtree/HPRtreeTest.java index 039f33ec42..df0403d7bf 100644 --- a/modules/core/src/test/java/org/locationtech/jts/index/hprtree/HPRtreeTest.java +++ b/modules/core/src/test/java/org/locationtech/jts/index/hprtree/HPRtreeTest.java @@ -52,6 +52,7 @@ public void testEmptyTreeUsingItemVisitorQuery() { HPRtree tree = new HPRtree(0); tree.query(new Envelope(0,0,1,1), new ItemVisitor() { + @Override public void visitItem(Object item) { assertTrue("Should never reach here", true); } diff --git a/modules/core/src/test/java/org/locationtech/jts/index/strtree/GeometryDistanceComparator.java b/modules/core/src/test/java/org/locationtech/jts/index/strtree/GeometryDistanceComparator.java index 6b52167348..f034b493ca 100644 --- a/modules/core/src/test/java/org/locationtech/jts/index/strtree/GeometryDistanceComparator.java +++ b/modules/core/src/test/java/org/locationtech/jts/index/strtree/GeometryDistanceComparator.java @@ -43,6 +43,7 @@ public GeometryDistanceComparator(Point queryCenter, boolean normalOrder) /* (non-Javadoc) * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object) */ + @Override public int compare(Geometry g1, Geometry g2) { double distance1 = g1.getEnvelopeInternal().distance(this.queryCenter.getEnvelopeInternal()); double distance2 = g2.getEnvelopeInternal().distance(this.queryCenter.getEnvelopeInternal()); diff --git a/modules/core/src/test/java/org/locationtech/jts/index/strtree/SIRtreeTest.java b/modules/core/src/test/java/org/locationtech/jts/index/strtree/SIRtreeTest.java index 27160dd438..41e8d216a5 100644 --- a/modules/core/src/test/java/org/locationtech/jts/index/strtree/SIRtreeTest.java +++ b/modules/core/src/test/java/org/locationtech/jts/index/strtree/SIRtreeTest.java @@ -31,7 +31,9 @@ public static void main(String[] args) { private static class TestTree extends SIRtree { public TestTree(int nodeCapacity) { super(nodeCapacity); } + @Override public AbstractNode getRoot() { return super.getRoot(); } + @Override protected List boundablesAtLevel(int level) { return super.boundablesAtLevel(level); } } diff --git a/modules/core/src/test/java/org/locationtech/jts/index/strtree/STRtreeTest.java b/modules/core/src/test/java/org/locationtech/jts/index/strtree/STRtreeTest.java index ff7744ff8f..2e2f18846d 100644 --- a/modules/core/src/test/java/org/locationtech/jts/index/strtree/STRtreeTest.java +++ b/modules/core/src/test/java/org/locationtech/jts/index/strtree/STRtreeTest.java @@ -59,6 +59,7 @@ public void testEmptyTreeUsingItemVisitorQuery() { STRtree tree = new STRtree(); tree.query(new Envelope(0,0,1,1), new ItemVisitor() { + @Override public void visitItem(Object item) { assertTrue("Should never reach here", true); } diff --git a/modules/core/src/test/java/org/locationtech/jts/io/WKBTest.java b/modules/core/src/test/java/org/locationtech/jts/io/WKBTest.java index 6928f4184a..a13561a289 100644 --- a/modules/core/src/test/java/org/locationtech/jts/io/WKBTest.java +++ b/modules/core/src/test/java/org/locationtech/jts/io/WKBTest.java @@ -246,6 +246,7 @@ void runGeometry(Geometry g, int dimension, int byteOrder, boolean toHex, int sr class AverageZFilter implements CoordinateFilter { + @Override public void filter(Coordinate coord) { coord.setZ((coord.x + coord.y) / 2); diff --git a/modules/core/src/test/java/org/locationtech/jts/linearref/LengthIndexedLineTest.java b/modules/core/src/test/java/org/locationtech/jts/linearref/LengthIndexedLineTest.java index cf2162337a..5d4948a743 100644 --- a/modules/core/src/test/java/org/locationtech/jts/linearref/LengthIndexedLineTest.java +++ b/modules/core/src/test/java/org/locationtech/jts/linearref/LengthIndexedLineTest.java @@ -132,6 +132,7 @@ public void testProjectPointWithDuplicateCoords() * These tests work for LengthIndexedLine, but not LocationIndexedLine * */ + @Override public void testOffsetStartPointRepeatedPoint() { runOffsetTest("LINESTRING (0 0, 10 10, 10 10, 20 20)", "POINT(0 0)", 1.0, "POINT (-0.7071067811865475 0.7071067811865475)"); @@ -181,6 +182,7 @@ private void checkExtractLine(String wkt, double start, double end, String expec checkExpected(result, expected); } + @Override protected Geometry indicesOfThenExtract(Geometry linearGeom, Geometry subLine) { LengthIndexedLine indexedLine = new LengthIndexedLine(linearGeom); @@ -189,6 +191,7 @@ protected Geometry indicesOfThenExtract(Geometry linearGeom, Geometry subLine) return result; } + @Override protected boolean indexOfAfterCheck(Geometry linearGeom, Coordinate testPt) { LengthIndexedLine indexedLine = new LengthIndexedLine(linearGeom); @@ -207,6 +210,7 @@ protected boolean indexOfAfterCheck(Geometry linearGeom, Coordinate testPt) return true; } + @Override protected boolean indexOfAfterCheck(Geometry linearGeom, Coordinate testPt, Coordinate checkPt) { LengthIndexedLine indexedLine = new LengthIndexedLine(linearGeom); @@ -219,6 +223,7 @@ protected boolean indexOfAfterCheck(Geometry linearGeom, Coordinate testPt, Coor return true; } + @Override protected Coordinate extractOffsetAt(Geometry linearGeom, Coordinate testPt, double offsetDistance) { LengthIndexedLine indexedLine = new LengthIndexedLine(linearGeom); diff --git a/modules/core/src/test/java/org/locationtech/jts/linearref/LocationIndexedLineTest.java b/modules/core/src/test/java/org/locationtech/jts/linearref/LocationIndexedLineTest.java index 5aee476be1..8919446c78 100644 --- a/modules/core/src/test/java/org/locationtech/jts/linearref/LocationIndexedLineTest.java +++ b/modules/core/src/test/java/org/locationtech/jts/linearref/LocationIndexedLineTest.java @@ -57,6 +57,7 @@ private void runExtractLine(String wkt, checkExpected(result, expected); } + @Override protected Geometry indicesOfThenExtract(Geometry input, Geometry subLine) { LocationIndexedLine indexedLine = new LocationIndexedLine(input); @@ -65,6 +66,7 @@ protected Geometry indicesOfThenExtract(Geometry input, Geometry subLine) return result; } + @Override protected boolean indexOfAfterCheck(Geometry linearGeom, Coordinate testPt) { LocationIndexedLine indexedLine = new LocationIndexedLine(linearGeom); @@ -83,6 +85,7 @@ protected boolean indexOfAfterCheck(Geometry linearGeom, Coordinate testPt) return true; } + @Override protected boolean indexOfAfterCheck(Geometry linearGeom, Coordinate testPt, Coordinate afterPt) { LocationIndexedLine indexedLine = new LocationIndexedLine(linearGeom); @@ -95,6 +98,7 @@ protected boolean indexOfAfterCheck(Geometry linearGeom, Coordinate testPt, Coor return true; } + @Override protected Coordinate extractOffsetAt(Geometry linearGeom, Coordinate testPt, double offsetDistance) { LocationIndexedLine indexedLine = new LocationIndexedLine(linearGeom); diff --git a/modules/core/src/test/java/org/locationtech/jts/operation/buffer/BufferValidator.java b/modules/core/src/test/java/org/locationtech/jts/operation/buffer/BufferValidator.java index 3cf73ae47e..d98346316f 100644 --- a/modules/core/src/test/java/org/locationtech/jts/operation/buffer/BufferValidator.java +++ b/modules/core/src/test/java/org/locationtech/jts/operation/buffer/BufferValidator.java @@ -65,6 +65,7 @@ public String toString() { } public abstract void test() throws Exception; private int priority; + @Override public int compareTo(Object o) { return priority - ((Test) o).priority; } @@ -126,6 +127,7 @@ private BufferValidator addTest(Test test) { } public BufferValidator setExpectedArea(final double expectedArea) { return addTest(new Test("Area Test") { + @Override public void test() throws Exception { double tolerance = Math.abs( @@ -146,6 +148,7 @@ public void test() throws Exception { public BufferValidator setEmptyBufferExpected(final boolean emptyBufferExpected) { return addTest(new Test("Empty Buffer Test", 1) { + @Override public void test() throws Exception { Assert.assertTrue( supplement( @@ -159,6 +162,7 @@ public void test() throws Exception { public BufferValidator setBufferHolesExpected(final boolean bufferHolesExpected) { return addTest(new Test("Buffer Holes Test") { + @Override public void test() throws Exception { Assert.assertTrue( supplement( @@ -221,6 +225,7 @@ private Geometry getBuffer() throws ParseException { private void addContainsTest() { addTest(new Test("Contains Test") { + @Override public void test() throws Exception { if (getOriginal().getClass() == GeometryCollection.class) { return; @@ -250,6 +255,7 @@ private boolean contains(Geometry a, Geometry b) { private void addBufferResultValidatorTest() { addTest(new Test("BufferResultValidator Test") { + @Override public void test() throws Exception { if (getOriginal().getClass() == GeometryCollection.class) { return; diff --git a/modules/core/src/test/java/org/locationtech/jts/operation/distance/IndexedFacetDistanceTest.java b/modules/core/src/test/java/org/locationtech/jts/operation/distance/IndexedFacetDistanceTest.java index 4400ea34e4..3e9dea5bc7 100644 --- a/modules/core/src/test/java/org/locationtech/jts/operation/distance/IndexedFacetDistanceTest.java +++ b/modules/core/src/test/java/org/locationtech/jts/operation/distance/IndexedFacetDistanceTest.java @@ -15,10 +15,12 @@ public IndexedFacetDistanceTest(String name) { super(name); } + @Override protected Coordinate[] nearestPoints(Geometry g1, Geometry g2) { return IndexedFacetDistance.nearestPoints(g1, g2); } + @Override public void testClosestPoints7() { // skip this test for now, since it relies on checking point-in-polygon } diff --git a/modules/core/src/test/java/test/jts/index/STRtreeDemo.java b/modules/core/src/test/java/test/jts/index/STRtreeDemo.java index 7dbf1cb760..dfeb4db0c7 100644 --- a/modules/core/src/test/java/test/jts/index/STRtreeDemo.java +++ b/modules/core/src/test/java/test/jts/index/STRtreeDemo.java @@ -39,14 +39,19 @@ public static class TestTree extends STRtree { public TestTree(int nodeCapacity) { super(nodeCapacity); } + @Override public List boundablesAtLevel(int level) { return super.boundablesAtLevel(level); } + @Override public AbstractNode getRoot() { return root; } + @Override public List createParentBoundables(List verticalSlice, int newLevel) { return super.createParentBoundables(verticalSlice, newLevel); } + @Override public List[] verticalSlices(List childBoundables, int size) { return super.verticalSlices(childBoundables, size); } + @Override public List createParentBoundablesFromVerticalSlice(List childBoundables, int newLevel) { return super.createParentBoundablesFromVerticalSlice(childBoundables, newLevel); } diff --git a/modules/core/src/test/java/test/jts/perf/ExamplePerfTest.java b/modules/core/src/test/java/test/jts/perf/ExamplePerfTest.java index 94d3a91f18..9acf3e40df 100644 --- a/modules/core/src/test/java/test/jts/perf/ExamplePerfTest.java +++ b/modules/core/src/test/java/test/jts/perf/ExamplePerfTest.java @@ -33,11 +33,13 @@ public ExamplePerfTest(String name) setRunIterations(10); } + @Override public void setUp() { // read data and allocate resources here } + @Override public void startRun(int size) { System.out.println("Running with size " + size); @@ -58,6 +60,7 @@ public void runTest2() // do test work here } + @Override public void tearDown() { // deallocate resources here diff --git a/modules/core/src/test/java/test/jts/perf/algorithm/ConvexHullPerfTest.java b/modules/core/src/test/java/test/jts/perf/algorithm/ConvexHullPerfTest.java index fc551f8f02..dd05ea6319 100644 --- a/modules/core/src/test/java/test/jts/perf/algorithm/ConvexHullPerfTest.java +++ b/modules/core/src/test/java/test/jts/perf/algorithm/ConvexHullPerfTest.java @@ -26,6 +26,7 @@ public ConvexHullPerfTest(String name) setRunIterations(100); } + @Override public void startRun(int num) { System.out.println("Running with size " + num); diff --git a/modules/core/src/test/java/test/jts/perf/algorithm/DDOrientationIndexAccuracyTest.java b/modules/core/src/test/java/test/jts/perf/algorithm/DDOrientationIndexAccuracyTest.java index bd0d0230f9..4abde5602b 100644 --- a/modules/core/src/test/java/test/jts/perf/algorithm/DDOrientationIndexAccuracyTest.java +++ b/modules/core/src/test/java/test/jts/perf/algorithm/DDOrientationIndexAccuracyTest.java @@ -79,11 +79,13 @@ static interface DDConverter { DD convert(double x); } static final DDConverter DD_STD = new DDConverter() { + @Override public DD convert(double x) { return DD.valueOf(x); } }; static final DDConverter DD_DEC = new DDConverter() { + @Override public DD convert(double x) { return DD.valueOf(x + ""); } diff --git a/modules/core/src/test/java/test/jts/perf/algorithm/IndexedPointInAreaPerfTest.java b/modules/core/src/test/java/test/jts/perf/algorithm/IndexedPointInAreaPerfTest.java index 5d8d632844..6bfd4b117a 100644 --- a/modules/core/src/test/java/test/jts/perf/algorithm/IndexedPointInAreaPerfTest.java +++ b/modules/core/src/test/java/test/jts/perf/algorithm/IndexedPointInAreaPerfTest.java @@ -28,6 +28,7 @@ public IndexedPointInAreaPerfTest(String name) List coords; Polygon polygon; + @Override public void startRun(int num) { System.out.println("Running with size " + num); diff --git a/modules/core/src/test/java/test/jts/perf/algorithm/InteriorPointAreaPerfTest.java b/modules/core/src/test/java/test/jts/perf/algorithm/InteriorPointAreaPerfTest.java index a3d5531131..eeefe08f8d 100644 --- a/modules/core/src/test/java/test/jts/perf/algorithm/InteriorPointAreaPerfTest.java +++ b/modules/core/src/test/java/test/jts/perf/algorithm/InteriorPointAreaPerfTest.java @@ -55,6 +55,7 @@ public InteriorPointAreaPerfTest(String name) setRunIterations(N_ITER); } + @Override public void setUp() { System.out.println("Interior Point Area perf test"); @@ -64,6 +65,7 @@ public void setUp() System.out.println("# Iterations: " + N_ITER); } + @Override public void startRun(int npts) { iter = 0; diff --git a/modules/core/src/test/java/test/jts/perf/algorithm/IntersectionPerfTest.java b/modules/core/src/test/java/test/jts/perf/algorithm/IntersectionPerfTest.java index de10230835..9d314243b5 100644 --- a/modules/core/src/test/java/test/jts/perf/algorithm/IntersectionPerfTest.java +++ b/modules/core/src/test/java/test/jts/perf/algorithm/IntersectionPerfTest.java @@ -68,6 +68,7 @@ public IntersectionPerfTest(String name) Coordinate q0; Coordinate q1; + @Override public void startRun(int npts) { p0 = new Coordinate(35613471.6165017, 4257145.3061322933); diff --git a/modules/core/src/test/java/test/jts/perf/algorithm/LineIntersectorBenchmark.java b/modules/core/src/test/java/test/jts/perf/algorithm/LineIntersectorBenchmark.java index 7316ccbd2e..dbb7eec74e 100644 --- a/modules/core/src/test/java/test/jts/perf/algorithm/LineIntersectorBenchmark.java +++ b/modules/core/src/test/java/test/jts/perf/algorithm/LineIntersectorBenchmark.java @@ -35,6 +35,7 @@ public static void main(String[] args) { lineIntersectorBenchmark.run(); } + @Override public void run() { exercise(new NonRobustLineIntersector()); exercise(new RobustLineIntersector()); diff --git a/modules/core/src/test/java/test/jts/perf/algorithm/MCIndexedPointInAreaLocator.java b/modules/core/src/test/java/test/jts/perf/algorithm/MCIndexedPointInAreaLocator.java index a664de2d9f..8d47de4507 100644 --- a/modules/core/src/test/java/test/jts/perf/algorithm/MCIndexedPointInAreaLocator.java +++ b/modules/core/src/test/java/test/jts/perf/algorithm/MCIndexedPointInAreaLocator.java @@ -70,6 +70,7 @@ private void buildIndex(Geometry g) * @param p the point to test * @return the location of the point in the geometry */ + @Override public int locate(Coordinate p) { RayCrossingCounter rcc = new RayCrossingCounter(p); @@ -100,6 +101,7 @@ public MCSegmentCounter(RayCrossingCounter rcc) this.rcc = rcc; } + @Override public void select(LineSegment ls) { rcc.countSegment(ls.getCoordinate(0), ls.getCoordinate(1)); diff --git a/modules/core/src/test/java/test/jts/perf/algorithm/SimpleRayCrossingStressTest.java b/modules/core/src/test/java/test/jts/perf/algorithm/SimpleRayCrossingStressTest.java index d6aca1b82c..96c35af245 100644 --- a/modules/core/src/test/java/test/jts/perf/algorithm/SimpleRayCrossingStressTest.java +++ b/modules/core/src/test/java/test/jts/perf/algorithm/SimpleRayCrossingStressTest.java @@ -68,6 +68,7 @@ public SimpleRayCrossingPointInAreaLocator(Geometry geom) this.geom = geom; } + @Override public int locate(Coordinate p) { RayCrossingCounter rcc = new RayCrossingCounter(p); @@ -87,6 +88,7 @@ public RayCrossingSegmentFilter(RayCrossingCounter rcc) this.rcc = rcc; } + @Override public void filter(CoordinateSequence seq, int i) { if (i == 0) return; @@ -95,8 +97,10 @@ public void filter(CoordinateSequence seq, int i) rcc.countSegment(p0, p1); } + @Override public boolean isDone() { return rcc.isOnSegment(); } + @Override public boolean isGeometryChanged() { return false; } } } diff --git a/modules/core/src/test/java/test/jts/perf/dissolve/LineDissolvePerfTest.java b/modules/core/src/test/java/test/jts/perf/dissolve/LineDissolvePerfTest.java index 56895a42e9..d8503da8db 100644 --- a/modules/core/src/test/java/test/jts/perf/dissolve/LineDissolvePerfTest.java +++ b/modules/core/src/test/java/test/jts/perf/dissolve/LineDissolvePerfTest.java @@ -45,6 +45,7 @@ public LineDissolvePerfTest(String name) { Collection data; + @Override public void setUp() throws IOException, ParseException { System.out.println("Loading data..."); diff --git a/modules/core/src/test/java/test/jts/perf/geom/LineSegmentHashCodePerfTest.java b/modules/core/src/test/java/test/jts/perf/geom/LineSegmentHashCodePerfTest.java index 2f20b4832c..7b674a5c80 100644 --- a/modules/core/src/test/java/test/jts/perf/geom/LineSegmentHashCodePerfTest.java +++ b/modules/core/src/test/java/test/jts/perf/geom/LineSegmentHashCodePerfTest.java @@ -55,6 +55,7 @@ public LineSegmentHashCodePerfTest(String name) { setRunSize(new int[] { 50, 100, 200, 400 }); } + @Override public void startRun(int size) { System.out.println("\nRunning with grid size " + size); diff --git a/modules/core/src/test/java/test/jts/perf/geom/prep/PreparedGeometryThreadSafeTest.java b/modules/core/src/test/java/test/jts/perf/geom/prep/PreparedGeometryThreadSafeTest.java index 93eaf8186b..7f77dd8ad9 100644 --- a/modules/core/src/test/java/test/jts/perf/geom/prep/PreparedGeometryThreadSafeTest.java +++ b/modules/core/src/test/java/test/jts/perf/geom/prep/PreparedGeometryThreadSafeTest.java @@ -47,6 +47,7 @@ public PreparedGeometryThreadSafeTest() } + @Override public void setup() { Geometry sinePoly = createSineStar(new Coordinate(0, 0), 100000.0, nPts); @@ -70,6 +71,7 @@ public Runnable getRunnable(final int threadIndex) { return new Runnable() { + @Override public void run() { while (true) { diff --git a/modules/core/src/test/java/test/jts/perf/geom/prep/PreparedPolygonLinesPerfTest.java b/modules/core/src/test/java/test/jts/perf/geom/prep/PreparedPolygonLinesPerfTest.java index 4a95ff2fe5..b3a3d2316d 100644 --- a/modules/core/src/test/java/test/jts/perf/geom/prep/PreparedPolygonLinesPerfTest.java +++ b/modules/core/src/test/java/test/jts/perf/geom/prep/PreparedPolygonLinesPerfTest.java @@ -64,6 +64,7 @@ public PreparedPolygonLinesPerfTest(String name) { setRunIterations(MAX_ITER); } + @Override public void startRun(int npts) { // Geometry poly = createCircle(new Coordinate(0, 0), 100, nPts); diff --git a/modules/core/src/test/java/test/jts/perf/geom/prep/PreparedPolygonPointsPerfTest.java b/modules/core/src/test/java/test/jts/perf/geom/prep/PreparedPolygonPointsPerfTest.java index 730527aceb..d4f6b455cc 100644 --- a/modules/core/src/test/java/test/jts/perf/geom/prep/PreparedPolygonPointsPerfTest.java +++ b/modules/core/src/test/java/test/jts/perf/geom/prep/PreparedPolygonPointsPerfTest.java @@ -63,6 +63,7 @@ public PreparedPolygonPointsPerfTest(String name) { setRunIterations(NUM_ITER); } + @Override public void startRun(int nPts) { // Geometry poly = createCircle(new Coordinate(0, 0), 100, nPts); diff --git a/modules/core/src/test/java/test/jts/perf/index/HPRtreePerfTest.java b/modules/core/src/test/java/test/jts/perf/index/HPRtreePerfTest.java index 76454f1bb1..82fe86e192 100644 --- a/modules/core/src/test/java/test/jts/perf/index/HPRtreePerfTest.java +++ b/modules/core/src/test/java/test/jts/perf/index/HPRtreePerfTest.java @@ -38,11 +38,13 @@ public HPRtreePerfTest(String name) { setRunIterations(1); } + @Override public void setUp() { } + @Override public void startRun(int size) { System.out.println("----- Tree size: " + size); diff --git a/modules/core/src/test/java/test/jts/perf/index/STRtreePerfTest.java b/modules/core/src/test/java/test/jts/perf/index/STRtreePerfTest.java index 9d7e02fb75..f857a26d55 100644 --- a/modules/core/src/test/java/test/jts/perf/index/STRtreePerfTest.java +++ b/modules/core/src/test/java/test/jts/perf/index/STRtreePerfTest.java @@ -33,11 +33,13 @@ public STRtreePerfTest(String name) { setRunIterations(1); } + @Override public void setUp() { } + @Override public void startRun(int size) { System.out.println("----- Tree size: " + size); diff --git a/modules/core/src/test/java/test/jts/perf/index/TreeTimeTest.java b/modules/core/src/test/java/test/jts/perf/index/TreeTimeTest.java index fd3126a1b9..d4cd9a63b1 100644 --- a/modules/core/src/test/java/test/jts/perf/index/TreeTimeTest.java +++ b/modules/core/src/test/java/test/jts/perf/index/TreeTimeTest.java @@ -76,14 +76,17 @@ public STRtreeIndex(int nodeCapacity) } STRtree index; + @Override public void insert(Envelope itemEnv, Object item) { index.insert(itemEnv, item); } + @Override public List query(Envelope searchEnv) { return index.query(searchEnv); } + @Override public void finishInserting() { index.build(); @@ -102,14 +105,17 @@ public HPRtreeIndex(int nodeCapacity) } HPRtree index; + @Override public void insert(Envelope itemEnv, Object item) { index.insert(itemEnv, item); } + @Override public List query(Envelope searchEnv) { return index.query(searchEnv); } + @Override public void finishInserting() { index.build(); @@ -122,14 +128,17 @@ class QuadtreeIndex { Quadtree index = new Quadtree(); public String toString() { return "Quad"; } + @Override public void insert(Envelope itemEnv, Object item) { index.insert(itemEnv, item); } + @Override public List query(Envelope searchEnv) { return index.query(searchEnv); } + @Override public void finishInserting() { } @@ -140,14 +149,17 @@ class EnvelopeListIndex { EnvelopeList index = new EnvelopeList(); public String toString() { return "Env"; } + @Override public void insert(Envelope itemEnv, Object item) { index.add(itemEnv); } + @Override public List query(Envelope searchEnv) { return index.query(searchEnv); } + @Override public void finishInserting() { } diff --git a/modules/core/src/test/java/test/jts/perf/operation/buffer/DepthSegmentStressTest.java b/modules/core/src/test/java/test/jts/perf/operation/buffer/DepthSegmentStressTest.java index 07fa9e6fba..5fdbf3be42 100644 --- a/modules/core/src/test/java/test/jts/perf/operation/buffer/DepthSegmentStressTest.java +++ b/modules/core/src/test/java/test/jts/perf/operation/buffer/DepthSegmentStressTest.java @@ -42,6 +42,7 @@ public DepthSegmentStressTest(String name) setRunIterations(100); } + @Override public void startRun(int size) { System.out.println("Running with size " + size); @@ -165,6 +166,7 @@ public DepthSegment(LineSegment seg, int depth) * @param obj * @return the comparison value */ + @Override public int compareTo(Object obj) { DepthSegment other = (DepthSegment) obj; diff --git a/modules/core/src/test/java/test/jts/perf/operation/distance/DistanceGeomPairPerfTest.java b/modules/core/src/test/java/test/jts/perf/operation/distance/DistanceGeomPairPerfTest.java index fbc049f44f..9450863480 100644 --- a/modules/core/src/test/java/test/jts/perf/operation/distance/DistanceGeomPairPerfTest.java +++ b/modules/core/src/test/java/test/jts/perf/operation/distance/DistanceGeomPairPerfTest.java @@ -50,6 +50,7 @@ public DistanceGeomPairPerfTest(String name) { private Geometry geom2; private Point pt2; + @Override public void startRun(int nPts) { //int nPts2 = nPts; diff --git a/modules/core/src/test/java/test/jts/perf/operation/overlayng/OverlayNGPerfTest.java b/modules/core/src/test/java/test/jts/perf/operation/overlayng/OverlayNGPerfTest.java index 27d5797f52..96c2f118ce 100644 --- a/modules/core/src/test/java/test/jts/perf/operation/overlayng/OverlayNGPerfTest.java +++ b/modules/core/src/test/java/test/jts/perf/operation/overlayng/OverlayNGPerfTest.java @@ -52,6 +52,7 @@ public OverlayNGPerfTest(String name) { setRunIterations(N_ITER); } + @Override public void setUp() { System.out.println("OverlaySR perf test"); @@ -63,6 +64,7 @@ public void setUp() System.out.println("Precision scale: " + PREC_SCALE_FACTOR); } + @Override public void startRun(int npts) { iter = 0; diff --git a/modules/core/src/test/java/test/jts/perf/operation/overlayng/OverlayNGSnapRoundingPerfTest.java b/modules/core/src/test/java/test/jts/perf/operation/overlayng/OverlayNGSnapRoundingPerfTest.java index 508e429a91..4f1ff82e08 100644 --- a/modules/core/src/test/java/test/jts/perf/operation/overlayng/OverlayNGSnapRoundingPerfTest.java +++ b/modules/core/src/test/java/test/jts/perf/operation/overlayng/OverlayNGSnapRoundingPerfTest.java @@ -59,6 +59,7 @@ public OverlayNGSnapRoundingPerfTest(String name) setRunIterations(N_ITER); } + @Override public void setUp() { System.out.println("OverlayNG Snap-Rounding perf test"); @@ -68,6 +69,7 @@ public void setUp() System.out.println("# Iterations: " + N_ITER); } + @Override public void startRun(int npts) { iter = 0; diff --git a/modules/core/src/test/java/test/jts/perf/operation/polygonize/PolygonizerPerfTest.java b/modules/core/src/test/java/test/jts/perf/operation/polygonize/PolygonizerPerfTest.java index ecb71551b6..7ac31a4976 100644 --- a/modules/core/src/test/java/test/jts/perf/operation/polygonize/PolygonizerPerfTest.java +++ b/modules/core/src/test/java/test/jts/perf/operation/polygonize/PolygonizerPerfTest.java @@ -41,6 +41,7 @@ public PolygonizerPerfTest(String name) { setRunIterations(1); } + @Override public void startRun(int num) { System.out.println("Running with size " + num); diff --git a/modules/core/src/test/java/test/jts/perf/operation/relate/RelateMonotoneLinesPerfTest.java b/modules/core/src/test/java/test/jts/perf/operation/relate/RelateMonotoneLinesPerfTest.java index e0d18f4c3b..6d04944161 100644 --- a/modules/core/src/test/java/test/jts/perf/operation/relate/RelateMonotoneLinesPerfTest.java +++ b/modules/core/src/test/java/test/jts/perf/operation/relate/RelateMonotoneLinesPerfTest.java @@ -55,6 +55,7 @@ public RelateMonotoneLinesPerfTest(String name) { LineString line1; LineString line2; + @Override public void startRun(int runSize) { int nVertices = runSize * DENSIFY_FACTOR; line1 = createLine("LINESTRING (0 0, 100 100)", nVertices); @@ -78,6 +79,7 @@ public void runIntersects() boolean isIntersects = line1.intersects(line2); } + @Override public void tearDown() { double[] timeFactor = computeTimeFactors(); System.out.print("Time factors: "); diff --git a/modules/core/src/test/java/test/jts/perf/operation/valid/IsValidNestedHolesPerfTest.java b/modules/core/src/test/java/test/jts/perf/operation/valid/IsValidNestedHolesPerfTest.java index 3a75458250..1c9aedafa0 100644 --- a/modules/core/src/test/java/test/jts/perf/operation/valid/IsValidNestedHolesPerfTest.java +++ b/modules/core/src/test/java/test/jts/perf/operation/valid/IsValidNestedHolesPerfTest.java @@ -44,6 +44,7 @@ public IsValidNestedHolesPerfTest(String name) Geometry geom; + @Override public void startRun(int npts) { geom = createSlantHoles(npts); diff --git a/modules/core/src/test/java/test/jts/perf/operation/valid/IsValidPolygonPerfTest.java b/modules/core/src/test/java/test/jts/perf/operation/valid/IsValidPolygonPerfTest.java index ceaa1b2b1c..bd562bd446 100644 --- a/modules/core/src/test/java/test/jts/perf/operation/valid/IsValidPolygonPerfTest.java +++ b/modules/core/src/test/java/test/jts/perf/operation/valid/IsValidPolygonPerfTest.java @@ -42,6 +42,7 @@ public IsValidPolygonPerfTest(String name) Geometry geom; + @Override public void startRun(int npts) { geom = createSineStar(npts); diff --git a/modules/core/src/test/java/test/jts/perf/precision/GeometryPrecisionReducerPerfTest.java b/modules/core/src/test/java/test/jts/perf/precision/GeometryPrecisionReducerPerfTest.java index e01a1239cd..ab18e108be 100644 --- a/modules/core/src/test/java/test/jts/perf/precision/GeometryPrecisionReducerPerfTest.java +++ b/modules/core/src/test/java/test/jts/perf/precision/GeometryPrecisionReducerPerfTest.java @@ -59,6 +59,7 @@ public GeometryPrecisionReducerPerfTest(String name) setRunIterations(N_ITER); } + @Override public void setUp() { System.out.println("Geometry Precision Reducer perf test"); @@ -68,6 +69,7 @@ public void setUp() System.out.println("# Iterations: " + N_ITER); } + @Override public void startRun(int npts) { iter = 0; diff --git a/modules/example/src/main/java/org/locationtech/jtsexample/geom/ExtendedCoordinate.java b/modules/example/src/main/java/org/locationtech/jtsexample/geom/ExtendedCoordinate.java index 0c9d95b82e..d552b63eaa 100644 --- a/modules/example/src/main/java/org/locationtech/jtsexample/geom/ExtendedCoordinate.java +++ b/modules/example/src/main/java/org/locationtech/jtsexample/geom/ExtendedCoordinate.java @@ -53,6 +53,7 @@ public ExtendedCoordinate(ExtendedCoordinate coord) m = coord.m; } + @Override public ExtendedCoordinate copy() { return new ExtendedCoordinate(this); } @@ -62,7 +63,9 @@ public ExtendedCoordinate copy() { * The m variable holds a measure value for linear referencing */ private double m; + @Override public double getM() { return m; } + @Override public void setM(double m) { this.m = m; } @Override diff --git a/modules/example/src/main/java/org/locationtech/jtsexample/geom/ExtendedCoordinateSequence.java b/modules/example/src/main/java/org/locationtech/jtsexample/geom/ExtendedCoordinateSequence.java index 9727e621c9..b58e4ae8e4 100644 --- a/modules/example/src/main/java/org/locationtech/jtsexample/geom/ExtendedCoordinateSequence.java +++ b/modules/example/src/main/java/org/locationtech/jtsexample/geom/ExtendedCoordinateSequence.java @@ -86,6 +86,7 @@ public ExtendedCoordinateSequence(int size) { /** * @see org.locationtech.jts.geom.CoordinateSequence#getDimension() */ + @Override public int getDimension() { return 4; } @Override @@ -100,6 +101,7 @@ public Coordinate createCoordinate() return new ExtendedCoordinate(); } + @Override public Coordinate getCoordinate(int i) { return coordinates[i]; } @@ -107,12 +109,14 @@ public Coordinate getCoordinate(int i) { /** * @see org.locationtech.jts.geom.CoordinateSequence#getX(int) */ + @Override public Coordinate getCoordinateCopy(int index) { return new Coordinate(coordinates[index]); } /** * @see org.locationtech.jts.geom.CoordinateSequence#getX(int) */ + @Override public void getCoordinate(int index, Coordinate coord) { coord.x = coordinates[index].x; coord.y = coordinates[index].y; @@ -124,6 +128,7 @@ public void getCoordinate(int index, Coordinate coord) { /** * @see org.locationtech.jts.geom.CoordinateSequence#getX(int) */ + @Override public double getX(int index) { return coordinates[index].x; } @@ -131,6 +136,7 @@ public double getX(int index) { /** * @see org.locationtech.jts.geom.CoordinateSequence#getY(int) */ + @Override public double getY(int index) { return coordinates[index].y; } @@ -138,6 +144,7 @@ public double getY(int index) { /** * @see org.locationtech.jts.geom.CoordinateSequence#getOrdinate(int, int) */ + @Override public double getOrdinate(int index, int ordinateIndex) { switch (ordinateIndex) { @@ -152,6 +159,7 @@ public double getOrdinate(int index, int ordinateIndex) /** * @see org.locationtech.jts.geom.CoordinateSequence#setOrdinate(int, int, double) */ + @Override public void setOrdinate(int index, int ordinateIndex, double value) { switch (ordinateIndex) { @@ -173,10 +181,12 @@ public void setOrdinate(int index, int ordinateIndex, double value) /** * @deprecated */ + @Override public Object clone() { return copy(); } + @Override public ExtendedCoordinateSequence copy() { ExtendedCoordinate[] cloneCoordinates = new ExtendedCoordinate[size()]; for (int i = 0; i < coordinates.length; i++) { @@ -186,14 +196,17 @@ public ExtendedCoordinateSequence copy() { return new ExtendedCoordinateSequence(cloneCoordinates); } + @Override public int size() { return coordinates.length; } + @Override public Coordinate[] toCoordinateArray() { return coordinates; } + @Override public Envelope expandEnvelope(Envelope env) { for (int i = 0; i < coordinates.length; i++ ) { diff --git a/modules/example/src/main/java/org/locationtech/jtsexample/geom/ExtendedCoordinateSequenceFactory.java b/modules/example/src/main/java/org/locationtech/jtsexample/geom/ExtendedCoordinateSequenceFactory.java index fbce1fff4f..adae873930 100644 --- a/modules/example/src/main/java/org/locationtech/jtsexample/geom/ExtendedCoordinateSequenceFactory.java +++ b/modules/example/src/main/java/org/locationtech/jtsexample/geom/ExtendedCoordinateSequenceFactory.java @@ -41,12 +41,14 @@ public static ExtendedCoordinateSequenceFactory instance() { * directly if it is an instance of ExtendedCoordinate[]; otherwise it is * copied. */ + @Override public CoordinateSequence create(Coordinate[] coordinates) { return coordinates instanceof ExtendedCoordinate[] ? new ExtendedCoordinateSequence((ExtendedCoordinate[]) coordinates) : new ExtendedCoordinateSequence(coordinates); } + @Override public CoordinateSequence create(CoordinateSequence coordSeq) { return coordSeq instanceof ExtendedCoordinateSequence ? new ExtendedCoordinateSequence((ExtendedCoordinateSequence) coordSeq) @@ -56,6 +58,7 @@ public CoordinateSequence create(CoordinateSequence coordSeq) { /** * @see org.locationtech.jts.geom.CoordinateSequenceFactory#create(int, int) */ + @Override public CoordinateSequence create(int size, int dimension) { return new ExtendedCoordinateSequence(size); } diff --git a/modules/example/src/main/java/org/locationtech/jtsexample/io/gml2/KMLReaderExample.java b/modules/example/src/main/java/org/locationtech/jtsexample/io/gml2/KMLReaderExample.java index f8041f4ca1..b6658e4dec 100644 --- a/modules/example/src/main/java/org/locationtech/jtsexample/io/gml2/KMLReaderExample.java +++ b/modules/example/src/main/java/org/locationtech/jtsexample/io/gml2/KMLReaderExample.java @@ -109,6 +109,7 @@ public List getGeometries() *@param atts Description of the Parameter *@exception SAXException Description of the Exception */ + @Override public void startElement(String uri, String name, String qName, Attributes atts) throws SAXException { if (name.equalsIgnoreCase(GMLConstants.GML_POLYGON)) { @@ -122,7 +123,8 @@ public void startElement(String uri, String name, String qName, } } - public void characters(char[] ch, int start, int length) throws SAXException + @Override + public void characters(char[] ch, int start, int length) throws SAXException { if (currGeomHandler != null) { currGeomHandler.characters(ch, start, length); @@ -135,6 +137,7 @@ public void characters(char[] ch, int start, int length) throws SAXException } } + @Override public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException { if (currGeomHandler != null) @@ -150,6 +153,7 @@ public void ignorableWhitespace(char[] ch, int start, int length) *@param qName Description of the Parameter *@exception SAXException Description of the Exception */ + @Override public void endElement(String uri, String name, String qName) throws SAXException { // System.out.println("/" + name); @@ -179,6 +183,7 @@ public void endElement(String uri, String name, String qName) */ class FixingGeometryFactory extends GeometryFactory { + @Override public LinearRing createLinearRing(CoordinateSequence cs) { if (cs.getCoordinate(0).equals(cs.getCoordinate(cs.size() - 1))) diff --git a/modules/io/common/src/main/java/org/locationtech/jts/io/geojson/GeoJsonWriter.java b/modules/io/common/src/main/java/org/locationtech/jts/io/geojson/GeoJsonWriter.java index cdaee6d58e..3279f2a8ca 100644 --- a/modules/io/common/src/main/java/org/locationtech/jts/io/geojson/GeoJsonWriter.java +++ b/modules/io/common/src/main/java/org/locationtech/jts/io/geojson/GeoJsonWriter.java @@ -147,6 +147,7 @@ private Map create(Geometry geometry, boolean encodeCRS) { result.put(GeoJsonConstants.NAME_COORDINATES, new JSONAware() { + @Override public String toJSONString() { return jsonString; } @@ -161,6 +162,7 @@ public String toJSONString() { result.put(GeoJsonConstants.NAME_COORDINATES, new JSONAware() { + @Override public String toJSONString() { return jsonString; } @@ -238,6 +240,7 @@ private List makeJsonAware(Polygon poly) { .getCoordinateSequence()); result.add(new JSONAware() { + @Override public String toJSONString() { return jsonString; } @@ -248,6 +251,7 @@ public String toJSONString() { .getCoordinateSequence()); result.add(new JSONAware() { + @Override public String toJSONString() { return jsonString; } @@ -274,6 +278,7 @@ else if (geometry instanceof LineString) { .getCoordinateSequence()); list.add(new JSONAware() { + @Override public String toJSONString() { return jsonString; } @@ -284,6 +289,7 @@ else if (geometry instanceof Point) { final String jsonString = getJsonString(point.getCoordinateSequence()); list.add(new JSONAware() { + @Override public String toJSONString() { return jsonString; } diff --git a/modules/lab/src/main/java/org/locationtech/jts/operation/overlayarea/OverlayArea.java b/modules/lab/src/main/java/org/locationtech/jts/operation/overlayarea/OverlayArea.java index 8e475ebd52..f94b04dc8c 100644 --- a/modules/lab/src/main/java/org/locationtech/jts/operation/overlayarea/OverlayArea.java +++ b/modules/lab/src/main/java/org/locationtech/jts/operation/overlayarea/OverlayArea.java @@ -243,6 +243,7 @@ class IntersectionVisitor implements ItemVisitor { return area; } + @Override public void visitItem(Object item) { LineSegment seg = (LineSegment) item; area += areaForIntersection(seg.p0, seg.p1, b0, b1); diff --git a/modules/lab/src/main/java/org/locationtech/jtslab/clean/HoleRemover.java b/modules/lab/src/main/java/org/locationtech/jtslab/clean/HoleRemover.java index 67dff5bfaa..d5308e0d45 100644 --- a/modules/lab/src/main/java/org/locationtech/jtslab/clean/HoleRemover.java +++ b/modules/lab/src/main/java/org/locationtech/jtslab/clean/HoleRemover.java @@ -57,6 +57,7 @@ public Geometry getResult() } private class HoleRemoverMapOp implements MapOp { + @Override public Geometry map(Geometry geom) { if (geom instanceof Polygon) return PolygonHoleRemover.clean((Polygon) geom, isRemoved); diff --git a/modules/lab/src/main/java/org/locationtech/jtslab/clean/InvalidHoleRemover.java b/modules/lab/src/main/java/org/locationtech/jtslab/clean/InvalidHoleRemover.java index c89990455e..2e2ed8f678 100644 --- a/modules/lab/src/main/java/org/locationtech/jtslab/clean/InvalidHoleRemover.java +++ b/modules/lab/src/main/java/org/locationtech/jtslab/clean/InvalidHoleRemover.java @@ -71,6 +71,7 @@ public Geometry getResult() private static class InvalidHoleRemoverMapOp implements MapOp { + @Override public Geometry map(Geometry geom) { if (geom instanceof Polygon) return PolygonInvalidHoleRemover.clean((Polygon) geom); diff --git a/modules/lab/src/main/java/org/locationtech/jtslab/clean/SmallHoleRemover.java b/modules/lab/src/main/java/org/locationtech/jtslab/clean/SmallHoleRemover.java index 07e471323f..8d6f449529 100644 --- a/modules/lab/src/main/java/org/locationtech/jtslab/clean/SmallHoleRemover.java +++ b/modules/lab/src/main/java/org/locationtech/jtslab/clean/SmallHoleRemover.java @@ -29,6 +29,7 @@ public IsSmall(double area) { this.area = area; } + @Override public boolean value(Geometry geom) { double holeArea = Area.ofRing(geom.getCoordinates()); return holeArea <= area; diff --git a/modules/lab/src/main/java/org/locationtech/jtslab/geom/util/GeometryEditorEx.java b/modules/lab/src/main/java/org/locationtech/jtslab/geom/util/GeometryEditorEx.java index e5f6c55bcd..c958163649 100644 --- a/modules/lab/src/main/java/org/locationtech/jtslab/geom/util/GeometryEditorEx.java +++ b/modules/lab/src/main/java/org/locationtech/jtslab/geom/util/GeometryEditorEx.java @@ -335,6 +335,7 @@ public interface GeometryEditorOperation public static class NoOpGeometryOperation implements GeometryEditorOperation { + @Override public Geometry edit(Geometry geometry, GeometryFactory targetFactory) { return geometry; @@ -348,6 +349,7 @@ public Geometry edit(Geometry geometry, GeometryFactory targetFactory) public abstract static class CoordinateOperation implements GeometryEditorOperation { + @Override public final Geometry edit(Geometry geometry, GeometryFactory targetFactory) { if (geometry instanceof LinearRing) { return targetFactory.createLinearRing(edit(geometry.getCoordinates(), @@ -393,6 +395,7 @@ public abstract Coordinate[] edit(Coordinate[] coordinates, public abstract static class CoordinateSequenceOperation implements GeometryEditorOperation { + @Override public final Geometry edit(Geometry geometry, GeometryFactory targetFactory) { if (geometry instanceof LinearRing) { return targetFactory.createLinearRing(edit( diff --git a/modules/lab/src/test/java/org/locationtech/jtslab/edgeray/EdgerayPerfTest.java b/modules/lab/src/test/java/org/locationtech/jtslab/edgeray/EdgerayPerfTest.java index 9ec4b8c916..df66d01cd2 100644 --- a/modules/lab/src/test/java/org/locationtech/jtslab/edgeray/EdgerayPerfTest.java +++ b/modules/lab/src/test/java/org/locationtech/jtslab/edgeray/EdgerayPerfTest.java @@ -22,6 +22,7 @@ public EdgerayPerfTest(String name) { setRunIterations(1); } + @Override public void startRun(int size) { System.out.println("\n--- Running with size " + size + " -----------"); diff --git a/modules/lab/src/test/java/test/jts/perf/operation/overlayarea/OverlayAreaGridsPerfTest.java b/modules/lab/src/test/java/test/jts/perf/operation/overlayarea/OverlayAreaGridsPerfTest.java index b2a6050470..08b290772c 100644 --- a/modules/lab/src/test/java/test/jts/perf/operation/overlayarea/OverlayAreaGridsPerfTest.java +++ b/modules/lab/src/test/java/test/jts/perf/operation/overlayarea/OverlayAreaGridsPerfTest.java @@ -45,6 +45,7 @@ public OverlayAreaGridsPerfTest(String name) { setRunIterations(1); } + @Override public void startRun(int size) throws IOException, ParseException { //geom = createSineStar(10_000, 0); diff --git a/modules/lab/src/test/java/test/jts/perf/operation/overlayarea/OverlayAreaStarsGridPerfTest.java b/modules/lab/src/test/java/test/jts/perf/operation/overlayarea/OverlayAreaStarsGridPerfTest.java index 3556d06ca0..bf7fe2ed0e 100644 --- a/modules/lab/src/test/java/test/jts/perf/operation/overlayarea/OverlayAreaStarsGridPerfTest.java +++ b/modules/lab/src/test/java/test/jts/perf/operation/overlayarea/OverlayAreaStarsGridPerfTest.java @@ -42,6 +42,7 @@ public OverlayAreaStarsGridPerfTest(String name) { setRunIterations(1); } + @Override public void startRun(int size) throws IOException, ParseException { geom = createSineStar(size, 0); diff --git a/modules/lab/src/test/java/test/jts/perf/operation/overlayarea/OverlayAreaStarsPerfTest.java b/modules/lab/src/test/java/test/jts/perf/operation/overlayarea/OverlayAreaStarsPerfTest.java index 4efea64280..a3e137870f 100644 --- a/modules/lab/src/test/java/test/jts/perf/operation/overlayarea/OverlayAreaStarsPerfTest.java +++ b/modules/lab/src/test/java/test/jts/perf/operation/overlayarea/OverlayAreaStarsPerfTest.java @@ -34,6 +34,7 @@ public OverlayAreaStarsPerfTest(String name) { setRunIterations(1); } + @Override public void startRun(int size) { System.out.println("\n--- Running with size " + size + " -----------"); diff --git a/modules/lab/src/test/java/test/jts/perf/operation/overlayarea/SimpleOverlayAreaPerfTest.java b/modules/lab/src/test/java/test/jts/perf/operation/overlayarea/SimpleOverlayAreaPerfTest.java index e4a7fc08b1..11ddd2e73a 100644 --- a/modules/lab/src/test/java/test/jts/perf/operation/overlayarea/SimpleOverlayAreaPerfTest.java +++ b/modules/lab/src/test/java/test/jts/perf/operation/overlayarea/SimpleOverlayAreaPerfTest.java @@ -39,6 +39,7 @@ public SimpleOverlayAreaPerfTest(String name) { setRunIterations(10000); } + @Override public void startRun(int size) throws IOException, ParseException { WKTReader rdr= new WKTReader(); diff --git a/modules/tests/src/main/java/org/locationtech/jtstest/geomop/BaseGeometryFunction.java b/modules/tests/src/main/java/org/locationtech/jtstest/geomop/BaseGeometryFunction.java index f21ea73eda..05527e9154 100644 --- a/modules/tests/src/main/java/org/locationtech/jtstest/geomop/BaseGeometryFunction.java +++ b/modules/tests/src/main/java/org/locationtech/jtstest/geomop/BaseGeometryFunction.java @@ -73,6 +73,7 @@ public String getCategory() return category; } + @Override public String getName() { return name; @@ -83,6 +84,7 @@ public String getDescription() return description; } + @Override public String[] getParameterNames() { return parameterNames; @@ -94,16 +96,19 @@ public String[] getParameterNames() * * @return the types */ + @Override public Class[] getParameterTypes() { return parameterTypes; } + @Override public Class getReturnType() { return returnType; } + @Override public boolean isBinary() { return parameterTypes.length > 0 && parameterTypes[0] == Geometry.class; } @@ -122,6 +127,7 @@ protected static Integer getIntegerOrNull(Object[] args, int index) return (Integer) args[index]; } + @Override public abstract Object invoke(Geometry geom, Object[] args); /** @@ -147,6 +153,7 @@ public boolean equals(Object obj) return true; } + @Override public int compareTo(Object o) { GeometryFunction func = (GeometryFunction) o; diff --git a/modules/tests/src/main/java/org/locationtech/jtstest/geomop/BufferValidatedGeometryOperation.java b/modules/tests/src/main/java/org/locationtech/jtstest/geomop/BufferValidatedGeometryOperation.java index 45a387664c..8da77be0ed 100644 --- a/modules/tests/src/main/java/org/locationtech/jtstest/geomop/BufferValidatedGeometryOperation.java +++ b/modules/tests/src/main/java/org/locationtech/jtstest/geomop/BufferValidatedGeometryOperation.java @@ -51,6 +51,7 @@ public BufferValidatedGeometryOperation() } + @Override public Class getReturnType(String opName) { return chainOp.getReturnType(opName); @@ -77,6 +78,7 @@ public BufferValidatedGeometryOperation(GeometryMethodOperation chainOp) * @throws Exception * @see GeometryOperation#invoke */ + @Override public Result invoke(String opName, Geometry geometry, Object[] args) throws Exception { diff --git a/modules/tests/src/main/java/org/locationtech/jtstest/geomop/GeometryFunctionOperation.java b/modules/tests/src/main/java/org/locationtech/jtstest/geomop/GeometryFunctionOperation.java index fc5bdce634..5e885bbb11 100644 --- a/modules/tests/src/main/java/org/locationtech/jtstest/geomop/GeometryFunctionOperation.java +++ b/modules/tests/src/main/java/org/locationtech/jtstest/geomop/GeometryFunctionOperation.java @@ -45,6 +45,7 @@ public GeometryFunctionOperation(GeometryFunctionRegistry registry) { this.registry = registry; } + @Override public Class getReturnType(String opName) { GeometryFunction func = registry.find(opName); @@ -53,6 +54,7 @@ public Class getReturnType(String opName) return func.getReturnType(); } + @Override public Result invoke(String opName, Geometry geometry, Object[] args) throws Exception { diff --git a/modules/tests/src/main/java/org/locationtech/jtstest/geomop/GeometryMethodOperation.java b/modules/tests/src/main/java/org/locationtech/jtstest/geomop/GeometryMethodOperation.java index 6e09c753bf..abbeb31967 100644 --- a/modules/tests/src/main/java/org/locationtech/jtstest/geomop/GeometryMethodOperation.java +++ b/modules/tests/src/main/java/org/locationtech/jtstest/geomop/GeometryMethodOperation.java @@ -78,11 +78,13 @@ public static Class getGeometryReturnType(String functionName) { public GeometryMethodOperation() { } + @Override public Class getReturnType(String opName) { return getGeometryReturnType(opName); } + @Override public Result invoke(String opName, Geometry geometry, Object[] args) throws Exception { diff --git a/modules/tests/src/main/java/org/locationtech/jtstest/geomop/LoggingGeometryOperation.java b/modules/tests/src/main/java/org/locationtech/jtstest/geomop/LoggingGeometryOperation.java index d8d2b842fa..458aef522b 100644 --- a/modules/tests/src/main/java/org/locationtech/jtstest/geomop/LoggingGeometryOperation.java +++ b/modules/tests/src/main/java/org/locationtech/jtstest/geomop/LoggingGeometryOperation.java @@ -34,6 +34,7 @@ public LoggingGeometryOperation() } + @Override public Class getReturnType(String opName) { return GeometryMethodOperation.getGeometryReturnType(opName); @@ -44,6 +45,7 @@ public LoggingGeometryOperation(GeometryOperation geomOp) this.geomOp = geomOp; } + @Override public Result invoke(String opName, Geometry geometry, Object[] args) throws Exception { diff --git a/modules/tests/src/main/java/org/locationtech/jtstest/geomop/NormalizedGeometryMatcher.java b/modules/tests/src/main/java/org/locationtech/jtstest/geomop/NormalizedGeometryMatcher.java index 3a41a8d3f5..c44f0cad10 100644 --- a/modules/tests/src/main/java/org/locationtech/jtstest/geomop/NormalizedGeometryMatcher.java +++ b/modules/tests/src/main/java/org/locationtech/jtstest/geomop/NormalizedGeometryMatcher.java @@ -25,11 +25,13 @@ public NormalizedGeometryMatcher() } + @Override public void setTolerance(double tolerance) { this.tolerance = tolerance; } + @Override public boolean match(Geometry a, Geometry b) { Geometry aClone = (Geometry)a.clone(); diff --git a/modules/tests/src/main/java/org/locationtech/jtstest/geomop/OverlayValidatedGeometryOperation.java b/modules/tests/src/main/java/org/locationtech/jtstest/geomop/OverlayValidatedGeometryOperation.java index 2459090221..db2812ed10 100644 --- a/modules/tests/src/main/java/org/locationtech/jtstest/geomop/OverlayValidatedGeometryOperation.java +++ b/modules/tests/src/main/java/org/locationtech/jtstest/geomop/OverlayValidatedGeometryOperation.java @@ -56,6 +56,7 @@ public OverlayValidatedGeometryOperation() } + @Override public Class getReturnType(String opName) { return chainOp.getReturnType(opName); @@ -82,6 +83,7 @@ public OverlayValidatedGeometryOperation(GeometryMethodOperation chainOp) * @throws Exception * @see GeometryOperation#invoke */ + @Override public Result invoke(String opName, Geometry geometry, Object[] args) throws Exception { diff --git a/modules/tests/src/main/java/org/locationtech/jtstest/geomop/PreparedGeometryOperation.java b/modules/tests/src/main/java/org/locationtech/jtstest/geomop/PreparedGeometryOperation.java index a041fb22dc..7809ff78d4 100644 --- a/modules/tests/src/main/java/org/locationtech/jtstest/geomop/PreparedGeometryOperation.java +++ b/modules/tests/src/main/java/org/locationtech/jtstest/geomop/PreparedGeometryOperation.java @@ -39,6 +39,7 @@ public PreparedGeometryOperation() } + @Override public Class getReturnType(String opName) { if (isPreparedOp(opName)) @@ -76,6 +77,7 @@ private static boolean isPreparedOp(String opName) * @throws Exception * @see GeometryOperation#invoke */ + @Override public Result invoke(String opName, Geometry geometry, Object[] args) throws Exception { diff --git a/modules/tests/src/main/java/org/locationtech/jtstest/geomop/PreparedGeometryTeeOperation.java b/modules/tests/src/main/java/org/locationtech/jtstest/geomop/PreparedGeometryTeeOperation.java index e02c418c9b..9f29f31788 100644 --- a/modules/tests/src/main/java/org/locationtech/jtstest/geomop/PreparedGeometryTeeOperation.java +++ b/modules/tests/src/main/java/org/locationtech/jtstest/geomop/PreparedGeometryTeeOperation.java @@ -40,6 +40,7 @@ public PreparedGeometryTeeOperation(GeometryMethodOperation chainOp) super(chainOp); } + @Override protected void runTeeOp(String opName, Geometry geometry, Object[] args) { if (args.length < 1) return; diff --git a/modules/tests/src/main/java/org/locationtech/jtstest/geomop/StaticMethodGeometryFunction.java b/modules/tests/src/main/java/org/locationtech/jtstest/geomop/StaticMethodGeometryFunction.java index b3397dfb72..ad2da1cc10 100644 --- a/modules/tests/src/main/java/org/locationtech/jtstest/geomop/StaticMethodGeometryFunction.java +++ b/modules/tests/src/main/java/org/locationtech/jtstest/geomop/StaticMethodGeometryFunction.java @@ -74,7 +74,8 @@ public StaticMethodGeometryFunction( this.method = method; } - public Object invoke(Geometry g, Object[] arg) + @Override + public Object invoke(Geometry g, Object[] arg) { return invoke(method, null, createFullArgs(g, arg)); } diff --git a/modules/tests/src/main/java/org/locationtech/jtstest/geomop/TeeGeometryOperation.java b/modules/tests/src/main/java/org/locationtech/jtstest/geomop/TeeGeometryOperation.java index 4ef8b332e0..41334db804 100644 --- a/modules/tests/src/main/java/org/locationtech/jtstest/geomop/TeeGeometryOperation.java +++ b/modules/tests/src/main/java/org/locationtech/jtstest/geomop/TeeGeometryOperation.java @@ -39,6 +39,7 @@ public TeeGeometryOperation() } + @Override public Class getReturnType(String opName) { return chainOp.getReturnType(opName); @@ -65,6 +66,7 @@ public TeeGeometryOperation(GeometryMethodOperation chainOp) * @throws Exception * @see GeometryOperation#invoke */ + @Override public Result invoke(String opName, Geometry geometry, Object[] args) throws Exception { diff --git a/modules/tests/src/main/java/org/locationtech/jtstest/testrunner/BooleanResult.java b/modules/tests/src/main/java/org/locationtech/jtstest/testrunner/BooleanResult.java index c0cd644e6a..5c64b0f443 100644 --- a/modules/tests/src/main/java/org/locationtech/jtstest/testrunner/BooleanResult.java +++ b/modules/tests/src/main/java/org/locationtech/jtstest/testrunner/BooleanResult.java @@ -26,6 +26,7 @@ public BooleanResult(Boolean result) { this(result.booleanValue()); } + @Override public boolean equals(Result other, double tolerance) { if (!(other instanceof BooleanResult)) return false; @@ -33,14 +34,17 @@ public boolean equals(Result other, double tolerance) { return result == otherBooleanResult.result; } + @Override public String toFormattedString() { return toShortString(); } + @Override public String toLongString() { return toShortString(); } + @Override public String toShortString() { return result ? "true" : "false"; } diff --git a/modules/tests/src/main/java/org/locationtech/jtstest/testrunner/BufferResultMatcher.java b/modules/tests/src/main/java/org/locationtech/jtstest/testrunner/BufferResultMatcher.java index 004a7d34c6..a37cba8445 100644 --- a/modules/tests/src/main/java/org/locationtech/jtstest/testrunner/BufferResultMatcher.java +++ b/modules/tests/src/main/java/org/locationtech/jtstest/testrunner/BufferResultMatcher.java @@ -34,7 +34,8 @@ public class BufferResultMatcher * * @return true if the actual and expected results are considered equal */ - public boolean isMatch(Geometry geom, String opName, Object[] args, + @Override + public boolean isMatch(Geometry geom, String opName, Object[] args, Result actualResult, Result expectedResult, double tolerance) { diff --git a/modules/tests/src/main/java/org/locationtech/jtstest/testrunner/DoubleResult.java b/modules/tests/src/main/java/org/locationtech/jtstest/testrunner/DoubleResult.java index cb5fa96323..e388609fdd 100644 --- a/modules/tests/src/main/java/org/locationtech/jtstest/testrunner/DoubleResult.java +++ b/modules/tests/src/main/java/org/locationtech/jtstest/testrunner/DoubleResult.java @@ -23,6 +23,7 @@ public DoubleResult(Double value) { this.value = value.doubleValue(); } + @Override public boolean equals(Result other, double tolerance) { if (!(other instanceof DoubleResult)) { return false; @@ -33,14 +34,17 @@ public boolean equals(Result other, double tolerance) { return Math.abs(value-otherValue) <= tolerance; } + @Override public String toLongString() { return Double.toString(value); } + @Override public String toFormattedString() { return Double.toString(value); } + @Override public String toShortString() { return Double.toString(value); } diff --git a/modules/tests/src/main/java/org/locationtech/jtstest/testrunner/EqualityResultMatcher.java b/modules/tests/src/main/java/org/locationtech/jtstest/testrunner/EqualityResultMatcher.java index 7502b6451c..4c0e8732cb 100644 --- a/modules/tests/src/main/java/org/locationtech/jtstest/testrunner/EqualityResultMatcher.java +++ b/modules/tests/src/main/java/org/locationtech/jtstest/testrunner/EqualityResultMatcher.java @@ -29,7 +29,8 @@ public class EqualityResultMatcher * * @return true if the actual and expected results are considered equal */ - public boolean isMatch(Geometry geom, String opName, Object[] args, + @Override + public boolean isMatch(Geometry geom, String opName, Object[] args, Result actualResult, Result expectedResult, double tolerance) { diff --git a/modules/tests/src/main/java/org/locationtech/jtstest/testrunner/GeometryResult.java b/modules/tests/src/main/java/org/locationtech/jtstest/testrunner/GeometryResult.java index bb47114b07..c31c1561c0 100644 --- a/modules/tests/src/main/java/org/locationtech/jtstest/testrunner/GeometryResult.java +++ b/modules/tests/src/main/java/org/locationtech/jtstest/testrunner/GeometryResult.java @@ -28,6 +28,7 @@ public Geometry getGeometry() { return geometry; } + @Override public boolean equals(Result other, double tolerance) { if (!(other instanceof GeometryResult)) { return false; @@ -43,15 +44,18 @@ public boolean equals(Result other, double tolerance) { return isEqual; } + @Override public String toLongString() { return geometry.toText(); } + @Override public String toFormattedString() { WKTWriter writer = new WKTWriter(); return writer.writeFormatted(geometry); } + @Override public String toShortString() { return geometry.getClass().getName(); } diff --git a/modules/tests/src/main/java/org/locationtech/jtstest/testrunner/IntegerResult.java b/modules/tests/src/main/java/org/locationtech/jtstest/testrunner/IntegerResult.java index 03825aaf4a..c6f518108b 100644 --- a/modules/tests/src/main/java/org/locationtech/jtstest/testrunner/IntegerResult.java +++ b/modules/tests/src/main/java/org/locationtech/jtstest/testrunner/IntegerResult.java @@ -23,6 +23,7 @@ public IntegerResult(Integer value) { this.value = value.intValue(); } + @Override public boolean equals(Result other, double tolerance) { if (!(other instanceof IntegerResult)) { return false; @@ -33,14 +34,17 @@ public boolean equals(Result other, double tolerance) { return Math.abs(value-otherValue) <= tolerance; } + @Override public String toLongString() { return Integer.toString(value); } + @Override public String toFormattedString() { return Integer.toString(value); } + @Override public String toShortString() { return Integer.toString(value); } diff --git a/modules/tests/src/main/java/org/locationtech/jtstest/testrunner/NullResultMatcher.java b/modules/tests/src/main/java/org/locationtech/jtstest/testrunner/NullResultMatcher.java index 3695f38919..4eba9a6399 100644 --- a/modules/tests/src/main/java/org/locationtech/jtstest/testrunner/NullResultMatcher.java +++ b/modules/tests/src/main/java/org/locationtech/jtstest/testrunner/NullResultMatcher.java @@ -28,7 +28,8 @@ public class NullResultMatcher * * @return true always */ - public boolean isMatch(Geometry geom, String opName, Object[] args, + @Override + public boolean isMatch(Geometry geom, String opName, Object[] args, Result actualResult, Result expectedResult, double tolerance) { diff --git a/modules/tests/src/main/java/org/locationtech/jtstest/testrunner/SimpleReportWriter.java b/modules/tests/src/main/java/org/locationtech/jtstest/testrunner/SimpleReportWriter.java index beed109b6a..a5459348de 100644 --- a/modules/tests/src/main/java/org/locationtech/jtstest/testrunner/SimpleReportWriter.java +++ b/modules/tests/src/main/java/org/locationtech/jtstest/testrunner/SimpleReportWriter.java @@ -32,6 +32,7 @@ public class SimpleReportWriter implements ReportWriter public SimpleReportWriter(boolean verbose) { this.verbose = verbose; } + @Override public String writeReport(TestEngine engine) { reportBuf = new StringWriter(); reportOnParsingProblems(engine.getParsingProblems()); diff --git a/modules/tests/src/main/java/org/locationtech/jtstest/testrunner/Test.java b/modules/tests/src/main/java/org/locationtech/jtstest/testrunner/Test.java index d163f5a02a..6cb9a73e4e 100644 --- a/modules/tests/src/main/java/org/locationtech/jtstest/testrunner/Test.java +++ b/modules/tests/src/main/java/org/locationtech/jtstest/testrunner/Test.java @@ -119,6 +119,7 @@ public void removeArgument(int i) { arguments.remove(i); } + @Override public void run() { try { exception = null; diff --git a/modules/tests/src/main/java/org/locationtech/jtstest/testrunner/TestCase.java b/modules/tests/src/main/java/org/locationtech/jtstest/testrunner/TestCase.java index 2cc9b38019..08b8a759fb 100644 --- a/modules/tests/src/main/java/org/locationtech/jtstest/testrunner/TestCase.java +++ b/modules/tests/src/main/java/org/locationtech/jtstest/testrunner/TestCase.java @@ -122,6 +122,7 @@ public void remove(Test test) { tests.remove(test); } + @Override public void run() { isRun = true; for (Test test : tests ) { diff --git a/modules/tests/src/main/java/org/locationtech/jtstest/testrunner/TestEngine.java b/modules/tests/src/main/java/org/locationtech/jtstest/testrunner/TestEngine.java index e80e731343..5eff2ed7b8 100644 --- a/modules/tests/src/main/java/org/locationtech/jtstest/testrunner/TestEngine.java +++ b/modules/tests/src/main/java/org/locationtech/jtstest/testrunner/TestEngine.java @@ -131,6 +131,7 @@ public void clearParsingProblems() { testReader.clearParsingProblems(); } + @Override public void run() { running = true; start = new Date(); diff --git a/modules/tests/src/main/java/org/locationtech/jtstest/testrunner/TestRun.java b/modules/tests/src/main/java/org/locationtech/jtstest/testrunner/TestRun.java index ba4051a348..26d056b9a0 100644 --- a/modules/tests/src/main/java/org/locationtech/jtstest/testrunner/TestRun.java +++ b/modules/tests/src/main/java/org/locationtech/jtstest/testrunner/TestRun.java @@ -132,6 +132,7 @@ public void addTestCase(TestCase testCase) { testCases.add(testCase); } + @Override public void run() { for (TestCase testCase : testCases ) { if (testCaseIndexToRun < 0 || testCase.getCaseIndex() == testCaseIndexToRun)