Skip to content

Commit 8eb856c

Browse files
committed
fix deprecation and some warnings
1 parent 52051b3 commit 8eb856c

File tree

6 files changed

+14
-10
lines changed

6 files changed

+14
-10
lines changed

src/org/openstreetmap/josm/plugins/conflation/MatchesComputation.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public static Collection<SimpleMatch> generateMatches(SimpleMatchSettings settin
5555
allPrimitives.addAll(subPrimitives);
5656

5757
AbstractMap.SimpleEntry<FeatureCollection,HashMap<OsmPrimitive, Throwable>>
58-
allFeaturesAndErrors = createFeatureCollection(allPrimitives, monitor);
58+
allFeaturesAndErrors = createFeatureCollection(allPrimitives/*, monitor*/);
5959

6060
FeatureCollection allFeatures = allFeaturesAndErrors.getKey();
6161
HashMap<OsmPrimitive, Throwable> allErrors = allFeaturesAndErrors.getValue();
@@ -141,7 +141,7 @@ private static FeatureSchema createSchema(Collection<OsmPrimitive> prims) {
141141
}
142142

143143
private static AbstractMap.SimpleEntry<FeatureCollection,HashMap<OsmPrimitive, Throwable>>
144-
createFeatureCollection(Collection<OsmPrimitive> prims, ProgressMonitor monitor)
144+
createFeatureCollection(Collection<OsmPrimitive> prims/*, ProgressMonitor monitor*/)
145145
{
146146
FeatureDataset dataset = new FeatureDataset(createSchema(prims));
147147
HashMap<OsmPrimitive, Throwable> errorset = new HashMap<OsmPrimitive, Throwable>();

src/org/openstreetmap/josm/plugins/conflation/SimpleMatchList.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import org.openstreetmap.josm.data.osm.OsmPrimitive;
1616

1717
/**
18-
* Holds a list of {@see Match}es and provides convenience functions.
18+
* Holds a list of {@link SimpleMatch}es and provides convenience functions.
1919
*/
2020
public class SimpleMatchList implements Iterable<SimpleMatch> {
2121
private final CopyOnWriteArrayList<SimpleMatchListListener> listeners = new CopyOnWriteArrayList<>();

src/org/openstreetmap/josm/plugins/conflation/SimpleMatchSettings.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import com.vividsolutions.jcs.conflate.polygonmatch.FCMatchFinder;
1515

1616
/**
17-
* Result of the configuration {@Link SettingsDialog}.
17+
* Result of the configuration {@link org.openstreetmap.josm.plugins.conflation.config.SettingsDialog}.
1818
* @author joshdoe
1919
*/
2020
public class SimpleMatchSettings {

src/org/openstreetmap/josm/plugins/conflation/SimpleMatchesTableModel.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,15 @@ public Class<?> getColumnClass(int c) {
7878
}
7979

8080
/**
81+
* Return list of matches
8182
* @return the matches
8283
*/
8384
public SimpleMatchList getMatches() {
8485
return matches;
8586
}
8687

8788
/**
89+
* Set matches
8890
* @param matches the matches to set
8991
*/
9092
public void setMatches(SimpleMatchList matches, SimpleMatchSettings settings) {

src/org/openstreetmap/josm/plugins/conflation/UnmatchedObjectListModel.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ public void beginUpdate() {
114114
}
115115

116116
/**
117+
* Begin update process
117118
* @see DataSet#beginUpdate()
118119
*/
119120
public void endUpdate() {

src/org/openstreetmap/josm/plugins/conflation/config/parser/ParsedTextArea.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import java.awt.event.ComponentListener;
1313
import java.awt.event.FocusEvent;
1414
import java.awt.event.FocusListener;
15+
import java.awt.geom.Rectangle2D;
1516
import java.util.List;
1617

1718
import javax.swing.JMenuItem;
@@ -159,20 +160,20 @@ private void updatePopup(JMenuItem popupMenuItem, String text, int position, boo
159160
JPopupMenu popup = (JPopupMenu) popupMenuItem.getParent();
160161
if ((text != null) && !text.isEmpty()) {
161162
Point textArealocation = getLocationOnScreen();
162-
Rectangle positionRect;
163+
Rectangle2D positionRect;
163164
try {
164-
positionRect = modelToView(position);
165+
positionRect = modelToView2D(position);
165166
} catch (BadLocationException e) {
166167
positionRect = new Rectangle(0, 0, getSize().width, getSize().height);
167168
}
168169
popupMenuItem.setText(text);
169170
repackPopupMenuWithoutFlicker(popup);
170171
if (above) {
171-
popup.setLocation(textArealocation.x + positionRect.x,
172-
textArealocation.y + positionRect.y - positionRect.height - popup.getHeight());
172+
popup.setLocation(textArealocation.x + (int)positionRect.getX(),
173+
textArealocation.y + (int)positionRect.getY() - (int)positionRect.getHeight() - popup.getHeight());
173174
} else {
174-
popup.setLocation(textArealocation.x + positionRect.x,
175-
textArealocation.y + positionRect.y + positionRect.height + 10);
175+
popup.setLocation(textArealocation.x + (int)positionRect.getX(),
176+
textArealocation.y + (int)positionRect.getY() + (int)positionRect.getHeight() + 10);
176177
}
177178
popup.setVisible(true);
178179
} else {

0 commit comments

Comments
 (0)