Skip to content

Commit fc8ef2c

Browse files
committed
rename TestBuidler element artifacts
1 parent 220a070 commit fc8ef2c

File tree

12 files changed

+81
-82
lines changed

12 files changed

+81
-82
lines changed

modules/app/src/main/java/org/locationtech/jtstest/testbuilder/AppStrings.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,27 +35,27 @@ public class AppStrings {
3535
public static final String TIP_WKT_PANEL_LOAD_GEOMETRY = "Load geometries";
3636
public static final String TIP_INSPECT_GEOMETRY = "Inspect Geometry";
3737

38-
static final String TIP_EXTRACT_COMPONENTS = "<html>Extract Components/Segments to Case<br><br>Components = Drag<br>Segments = Ctl-Drag</html>";
38+
static final String TIP_EXTRACT_ELEMENTS = "<html>Extract Elements/Segments to Case<br><br>Elements: Drag<br>Segments: Ctl-Drag</html>";
3939

40-
static final String TIP_DELETE_VERTEX_COMPONENT = "<html>Delete Components/Vertices<br><br>Delete Components = Drag<br>Delete Intersecting Components = Ctl-Drag<br>Delete Vertices = Right-Drag</html>";
40+
static final String TIP_DELETE_VERTEX_ELEMENT = "<html>Delete Components/Vertices<br><br>Delete Components: Drag<br>Delete Intersecting Components: Ctl-Drag<br>Delete Vertices: Right-Drag</html>";
4141

42-
static final String TIP_MOVE_VERTEX = "<html>Move/Add/Delete Vertex<br><br>Move = Drag<br>Add = Right-Click<br>Delete = Ctl-Right-Click</html>";
43-
static final String TIP_MOVE = "<html>Move<br><br>Geometry = Drag<br>Component = Ctl-Drag<br></html>";
42+
static final String TIP_MOVE_VERTEX = "<html>Move/Add/Delete Vertex<br><br>Move: Drag<br>Add: Right-Click<br>Delete: Ctl-Right-Click</html>";
43+
static final String TIP_MOVE = "<html>Move<br><br>Geometry: Drag<br>Element: Ctl-Drag<br></html>";
4444

4545
static final String TIP_PAN = "Pan";
4646
static final String TIP_ZOOM_TO_FULL_EXTENT = "Zoom To Full Extent";
4747
static final String TIP_ZOOM_TO_RESULT = "Zoom To Result";
4848
static final String TIP_ZOOM_TO_B = "Zoom To B";
4949
static final String TIP_ZOOM_TO_A = "Zoom To A";
5050
static final String TIP_ZOOM_1_1 = "Zoom 1:1";
51-
static final String TIP_ZOOM = "<html>Zoom In/Out | Pan<br><br>Zoom In = Left-Btn<br>Zoom Extent = Left-Drag<br>Zoom Out = Right-Btn<br>Pan = Right-Drag | Ctl-Drag</html>";
51+
static final String TIP_ZOOM = "<html>Zoom In/Out | Pan<br><br>Zoom In: Left-Btn<br>Zoom Extent: Left-Drag<br>Zoom Out: Right-Btn<br>Pan: Right-Drag | Ctl-Drag</html>";
5252

5353
static final String TIP_INFO = "Show Info on Geometry, Segment, or Point";
5454

5555
static final String TIP_DRAW_RECTANGLE = "Draw Rectangle";
5656
static final String TIP_DRAW_POINT = "Draw Point";
57-
static final String TIP_DRAW_LINE = "<html>Draw LineString<br><br>Add Pt = Left-Click<br>Stream = Left-Drag</html>";
58-
static final String TIP_DRAW_POLY = "<html>Draw Polygon<br><br>Add Pt = Left-Click<br>Stream = Left-Drag</html>";
57+
static final String TIP_DRAW_LINE = "<html>Draw LineString<br><br>Add Pt: Left-Click<br>Stream: Left-Drag</html>";
58+
static final String TIP_DRAW_POLY = "<html>Draw Polygon<br><br>Add Pt: Left-Click<br>Stream: Left-Drag</html>";
5959

6060

6161
static final String TIP_EXCHANGE_A_B = "Exchange A & B";
@@ -64,8 +64,8 @@ public class AppStrings {
6464
static final String TIP_CASE_DUP = "Duplicate Case";
6565
static final String TIP_CASE_ADD_NEW = "Add New Case";
6666

67-
static final String TIP_NEXT = "<html>Next Case<br><br>No Zoom = Ctl-Click</html>";
68-
static final String TIP_PREV = "<html>Previous Case<br><br>No Zoom = Ctl-Click</html>";
67+
static final String TIP_NEXT = "<html>Next Case<br><br>Keep View: Ctl-Click</html>";
68+
static final String TIP_PREV = "<html>Previous Case<br><br>Keep View: Ctl-Click</html>";
6969

7070
static final String TIP_PASTE_DATA = "Paste from WKT, WKB, or GML";
7171

@@ -75,13 +75,13 @@ public class AppStrings {
7575

7676
static final String TIP_EXECUTE = "Compute the result of the function";
7777

78-
public static final String TIP_SAVE_IMAGE = "<html>Save Image to Clipboard<br>Save Image to File = Ctl-Click</html>";
78+
public static final String TIP_SAVE_IMAGE = "<html>Save Image to Clipboard<br>Save Image to File: Ctl-Click</html>";
7979

8080
public static final String TIP_STYLE_VERTEX_ENABLE = "Show Vertices";
8181
public static final String TIP_STYLE_LINE_ENABLE = "Show Line";
8282
public static final String TIP_STYLE_FILL_ENABLE = "Show Fill";
8383

84-
public static final String TIP_LAYER_CLEAR = "<html>Clear Layer<br>Remove Layer = Ctl-Click</html>";
84+
public static final String TIP_LAYER_CLEAR = "<html>Clear Layer<br>Remove Layer: Ctl-Click</html>";
8585

8686
public static final String TIP_STYLE_VERTEX_LABEL_ENABLE = "Show vertex labels";
8787

modules/app/src/main/java/org/locationtech/jtstest/testbuilder/GeometryPopupMenu.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ private void initUI()
3535
extractComponentItem.addActionListener(
3636
new ActionListener() {
3737
public void actionPerformed(ActionEvent e) {
38-
JTSTestBuilder.controller().extractComponentsToTestCase(clickCoord);
38+
JTSTestBuilder.controller().extractElementsToTestCase(clickCoord);
3939
}
4040
});
4141
add(extractComponentItem);
@@ -44,7 +44,7 @@ public void actionPerformed(ActionEvent e) {
4444
copyComponentItem.addActionListener(
4545
new ActionListener() {
4646
public void actionPerformed(ActionEvent e) {
47-
JTSTestBuilder.controller().copyComponentToClipboard(clickCoord);
47+
JTSTestBuilder.controller().copyElementToClipboard(clickCoord);
4848
}
4949
});
5050
add(copyComponentItem);

modules/app/src/main/java/org/locationtech/jtstest/testbuilder/JTSTestBuilderToolBar.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ public void actionPerformed(ActionEvent e) {
248248
});
249249

250250
extractComponentButton = createToggleButton(
251-
AppStrings.TIP_EXTRACT_COMPONENTS,
251+
AppStrings.TIP_EXTRACT_ELEMENTS,
252252
new ImageIcon(this.getClass().getResource("ExtractComponent.png")),
253253
new java.awt.event.ActionListener() {
254254
public void actionPerformed(ActionEvent e)
@@ -268,7 +268,7 @@ public void actionPerformed(ActionEvent e)
268268
});
269269

270270
deleteVertexButton = createToggleButton(
271-
AppStrings.TIP_DELETE_VERTEX_COMPONENT,
271+
AppStrings.TIP_DELETE_VERTEX_ELEMENT,
272272
new ImageIcon(this.getClass().getResource("DeleteVertex.png")),
273273
new java.awt.event.ActionListener() {
274274
public void actionPerformed(ActionEvent e) {

modules/app/src/main/java/org/locationtech/jtstest/testbuilder/controller/JTSTestBuilderController.java

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
import org.locationtech.jtstest.testbuilder.ui.tools.PanTool;
4545
import org.locationtech.jtstest.testbuilder.ui.tools.PointTool;
4646
import org.locationtech.jtstest.testbuilder.ui.tools.RectangleTool;
47-
import org.locationtech.jtstest.testbuilder.ui.tools.SelectComponentTool;
47+
import org.locationtech.jtstest.testbuilder.ui.tools.SelectElementTool;
4848
import org.locationtech.jtstest.testbuilder.ui.tools.StreamPolygonTool;
4949
import org.locationtech.jtstest.testbuilder.ui.tools.Tool;
5050
import org.locationtech.jtstest.testbuilder.ui.tools.ZoomTool;
@@ -128,23 +128,23 @@ public void addTestCase(Geometry[] geom, String name)
128128
JTSTestBuilderFrame.instance().showGeomsTab();
129129
}
130130

131-
public void extractComponentsToTestCase(Coordinate pt)
131+
public void extractElementsToTestCase(Coordinate pt)
132132
{
133133
double toleranceInModel = editPanel().getToleranceInModel();
134134
LayerList lyrList = model().getLayers();
135-
Geometry comp = lyrList.getComponent(pt, toleranceInModel);
135+
Geometry comp = lyrList.getElement(pt, toleranceInModel);
136136
if (comp == null)
137137
return;
138138
model().addCase(new Geometry[] { comp, null });
139139
JTSTestBuilderFrame.instance().updateTestCases();
140140
}
141141

142-
public void extractComponentsToTestCase(Geometry aoi, boolean isSegments)
142+
public void extractElementsToTestCase(Geometry aoi, boolean isSegments)
143143
{
144144
//double toleranceInModel = JTSTestBuilderFrame.getGeometryEditPanel().getToleranceInModel();
145145
LayerList lyrList = model().getLayers();
146146
Geometry[] comp;
147-
comp = lyrList.getComponents(aoi, isSegments);
147+
comp = lyrList.getElements(aoi, isSegments);
148148
if (comp == null)
149149
return;
150150
model().addCase(comp);
@@ -153,21 +153,21 @@ public void extractComponentsToTestCase(Geometry aoi, boolean isSegments)
153153
modeZoomIn();
154154
}
155155

156-
public void copyComponentToClipboard(Coordinate pt)
156+
public void copyElementToClipboard(Coordinate pt)
157157
{
158158
double toleranceInModel = editPanel().getToleranceInModel();
159159
LayerList lyrList = model().getLayers();
160-
Geometry comp = lyrList.getComponent(pt, toleranceInModel);
160+
Geometry comp = lyrList.getElement(pt, toleranceInModel);
161161
if (comp == null)
162162
return;
163163
SwingUtil.copyToClipboard(comp, false);
164164
}
165165

166-
public void selectComponents(Geometry aoi)
166+
public void selectElements(Geometry aoi)
167167
{
168168
LayerList lyrList = model().getLayers();
169169
Geometry[] comp;
170-
comp = lyrList.getComponents(aoi);
170+
comp = lyrList.getElements(aoi);
171171
if (comp == null) {
172172
model().clearSelection();
173173
}
@@ -183,7 +183,6 @@ public void selectComponents(Geometry aoi)
183183
}
184184
geometryViewChanged();
185185
layerListRefresh();
186-
layerListUpdate();
187186
}
188187

189188

@@ -305,7 +304,7 @@ public void modeExtractComponent() {
305304
}
306305

307306
public void modeSelectComponent() {
308-
setTool(SelectComponentTool.getInstance());
307+
setTool(SelectElementTool.getInstance());
309308
}
310309

311310
public void modeDeleteVertex() {

modules/app/src/main/java/org/locationtech/jtstest/testbuilder/geom/ComponentLocater.java renamed to modules/app/src/main/java/org/locationtech/jtstest/testbuilder/geom/GeometryElementLocater.java

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,49 +23,49 @@
2323

2424

2525
/**
26-
* Locates the components of a Geometry
26+
* Locates the elements of a Geometry
2727
* which lie in a target area.
2828
*
2929
* @author Martin Davis
3030
* @see FacetLocater
3131
*/
32-
public class ComponentLocater {
32+
public class GeometryElementLocater {
3333

34-
public static List<GeometryLocation> getComponents(Geometry parentGeom, Coordinate queryPt, double tolerance) {
35-
ComponentLocater locater = new ComponentLocater(parentGeom);
36-
return locater.getComponents(queryPt, tolerance);
34+
public static List<GeometryLocation> getElements(Geometry parentGeom, Coordinate queryPt, double tolerance) {
35+
GeometryElementLocater locater = new GeometryElementLocater(parentGeom);
36+
return locater.getElements(queryPt, tolerance);
3737
}
3838

3939

4040
private Geometry parentGeom;
41-
private List<GeometryLocation> components = new ArrayList();
41+
private List<GeometryLocation> elements = new ArrayList();
4242
private Geometry aoi;
4343

44-
public ComponentLocater(Geometry parentGeom) {
44+
public GeometryElementLocater(Geometry parentGeom) {
4545
this.parentGeom = parentGeom;
4646
}
4747

4848
/**
4949
*
5050
* @param queryPt
5151
* @param tolerance
52-
* @return a List of the component Geometrys
52+
* @return a List of the element Geometrys
5353
*/
54-
public List<GeometryLocation> getComponents(Coordinate queryPt, double tolerance)
54+
public List<GeometryLocation> getElements(Coordinate queryPt, double tolerance)
5555
{
5656
//Coordinate queryPt = queryPt;
5757
//this.tolerance = tolerance;
5858
aoi = createAOI(queryPt, tolerance);
59-
return getComponents(aoi);
59+
return getElements(aoi);
6060
}
6161

62-
public List<GeometryLocation> getComponents(Geometry aoi)
62+
public List<GeometryLocation> getElements(Geometry aoi)
6363
{
6464
//Coordinate queryPt = queryPt;
6565
//this.tolerance = tolerance;
6666
this.aoi = aoi;
67-
findComponents(new Stack(), parentGeom, components);
68-
return components;
67+
findElements(new Stack(), parentGeom, elements);
68+
return elements;
6969
}
7070

7171
private Geometry createAOI(Coordinate queryPt, double tolerance)
@@ -75,21 +75,21 @@ private Geometry createAOI(Coordinate queryPt, double tolerance)
7575
return parentGeom.getFactory().toGeometry(env);
7676
}
7777

78-
private void findComponents(Stack path, Geometry geom, List components)
78+
private void findElements(Stack path, Geometry geom, List elements)
7979
{
8080
if (geom instanceof GeometryCollection) {
8181
for (int i = 0; i < geom.getNumGeometries(); i++ ) {
8282
Geometry subGeom = geom.getGeometryN(i);
8383
path.push(i);
84-
findComponents(path, subGeom, components);
84+
findElements(path, subGeom, elements);
8585
path.pop();
8686
}
8787
return;
8888
}
8989
// TODO: make this robust - do not use Geometry.intersects()
90-
// atomic component - check for match
90+
// atomic element - check for match
9191
if (aoi.intersects(geom))
92-
components.add(new GeometryLocation(parentGeom, geom,
92+
elements.add(new GeometryLocation(parentGeom, geom,
9393
FacetLocater.toIntArray(path)));
9494
}
9595

modules/app/src/main/java/org/locationtech/jtstest/testbuilder/geom/GeometryLocation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public GeometryLocation(Geometry parent, Geometry component, int[] componentPath
9090
this.pt = pt;
9191
}
9292

93-
public Geometry getComponent()
93+
public Geometry getElement()
9494
{
9595
return component;
9696
}

modules/app/src/main/java/org/locationtech/jtstest/testbuilder/model/GeometryEditModel.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import org.locationtech.jts.util.Assert;
2525
import org.locationtech.jtstest.testbuilder.JTSTestBuilder;
2626
import org.locationtech.jtstest.testbuilder.geom.AdjacentVertexFinder;
27-
import org.locationtech.jtstest.testbuilder.geom.ComponentLocater;
27+
import org.locationtech.jtstest.testbuilder.geom.GeometryElementLocater;
2828
import org.locationtech.jtstest.testbuilder.geom.GeometryCombiner;
2929
import org.locationtech.jtstest.testbuilder.geom.GeometryLocation;
3030
import org.locationtech.jtstest.testbuilder.geom.GeometryPointLocater;
@@ -336,11 +336,11 @@ public GeometryLocation locateVertex(Coordinate testPt, double tolerance)
336336
return GeometryPointLocater.locateVertex(getGeometry(), testPt, tolerance);
337337
}
338338

339-
public List<GeometryLocation> getComponents(Coordinate testPt, double tolerance)
339+
public List<GeometryLocation> getElements(Coordinate testPt, double tolerance)
340340
{
341341
Geometry geom = getGeometry();
342342
if (geom == null) return null;
343-
return ComponentLocater.getComponents(getGeometry(), testPt, tolerance);
343+
return GeometryElementLocater.getElements(getGeometry(), testPt, tolerance);
344344
}
345345

346346
public Coordinate locateVertexPt(Coordinate testPt, double tolerance)

modules/app/src/main/java/org/locationtech/jtstest/testbuilder/model/LayerList.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import org.locationtech.jts.geom.Geometry;
2121
import org.locationtech.jts.geom.GeometryFactory;
2222
import org.locationtech.jtstest.testbuilder.AppStrings;
23-
import org.locationtech.jtstest.testbuilder.geom.ComponentLocater;
23+
import org.locationtech.jtstest.testbuilder.geom.GeometryElementLocater;
2424
import org.locationtech.jtstest.testbuilder.geom.GeometryLocation;
2525
import org.locationtech.jtstest.testbuilder.geom.SegmentExtracter;
2626

@@ -68,31 +68,31 @@ public Layer getLayer(int i)
6868
*
6969
* @param pt
7070
* @param tolerance
71-
* @return component found, or null
71+
* @return element found, or null
7272
*/
73-
public Geometry getComponent(Coordinate pt, double tolerance)
73+
public Geometry getElement(Coordinate pt, double tolerance)
7474
{
7575
for (int i = 0; i < size(); i++) {
7676

7777
Layer lyr = getLayer(i);
7878
Geometry geom = lyr.getGeometry();
7979
if (geom == null) continue;
80-
ComponentLocater locater = new ComponentLocater(geom);
81-
List locs = locater.getComponents(pt, tolerance);
80+
GeometryElementLocater locater = new GeometryElementLocater(geom);
81+
List locs = locater.getElements(pt, tolerance);
8282
if (locs.size() > 0) {
8383
GeometryLocation loc = (GeometryLocation) locs.get(0);
84-
return loc.getComponent();
84+
return loc.getElement();
8585
}
8686
}
8787
return null;
8888
}
8989

90-
public Geometry[] getComponents(Geometry aoi)
90+
public Geometry[] getElements(Geometry aoi)
9191
{
92-
return getComponents(aoi, false);
92+
return getElements(aoi, false);
9393
}
9494

95-
public Geometry[] getComponents(Geometry aoi, boolean isSegments)
95+
public Geometry[] getElements(Geometry aoi, boolean isSegments)
9696
{
9797
Geometry comp[] = new Geometry[2];
9898
for (int i = 0; i < 2; i++) {
@@ -103,16 +103,16 @@ public Geometry[] getComponents(Geometry aoi, boolean isSegments)
103103
comp[i] = SegmentExtracter.extract(geom, aoi);
104104
}
105105
else {
106-
comp[i] = extractComponents(geom, aoi);
106+
comp[i] = extractElements(geom, aoi);
107107
}
108108
}
109109
return comp;
110110
}
111111

112-
private Geometry extractComponents(Geometry parentGeom, Geometry aoi)
112+
private Geometry extractElements(Geometry parentGeom, Geometry aoi)
113113
{
114-
ComponentLocater locater = new ComponentLocater(parentGeom);
115-
List locs = locater.getComponents(aoi);
114+
GeometryElementLocater locater = new GeometryElementLocater(parentGeom);
115+
List locs = locater.getElements(aoi);
116116
List geoms = extractLocationGeometry(locs);
117117
if (geoms.size() <= 0)
118118
return null;
@@ -130,7 +130,7 @@ private List extractLocationGeometry(List locs)
130130
List geoms = new ArrayList();
131131
for (Iterator i = locs.iterator(); i.hasNext();) {
132132
GeometryLocation loc = (GeometryLocation) i.next();
133-
geoms.add(loc.getComponent());
133+
geoms.add(loc.getElement());
134134
}
135135
return geoms;
136136
}

0 commit comments

Comments
 (0)