Changeset 36136 in osm for applications/editors/josm/plugins
- Timestamp:
- 2023-09-11T20:01:42+02:00 (14 months ago)
- Location:
- applications/editors/josm/plugins/reltoolbox
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/reltoolbox/src/relcontext/RelContextDialog.java
r36102 r36136 178 178 rcPanel.add(chosenRelationPanel, BorderLayout.NORTH); 179 179 180 roleBox.addPropertyChangeListener("enabled", new PropertyChangeListener() { 181 @Override 182 public void propertyChange(PropertyChangeEvent evt) { 183 boolean showRoleBox = roleBox.isEnabled(); 184 roleBox.setVisible(showRoleBox); 185 chosenRelationComponent.setVisible(!showRoleBox); 186 } 180 roleBox.addPropertyChangeListener("enabled", evt -> { 181 boolean showRoleBox = roleBox.isEnabled(); 182 roleBox.setVisible(showRoleBox); 183 chosenRelationComponent.setVisible(!showRoleBox); 187 184 }); 188 185 189 sortAndFixAction.addPropertyChangeListener(new PropertyChangeListener() { 190 @Override 191 public void propertyChange(PropertyChangeEvent evt) { 192 sortAndFixButton.setVisible(sortAndFixAction.isEnabled()); 193 } 194 }); 186 sortAndFixAction.addPropertyChangeListener(evt -> sortAndFixButton.setVisible(sortAndFixAction.isEnabled())); 195 187 sortAndFixButton.setVisible(false); 196 188 197 downloadChosenRelationAction.addPropertyChangeListener(new PropertyChangeListener() { 198 @Override 199 public void propertyChange(PropertyChangeEvent evt) { 200 downloadButton.setVisible(downloadChosenRelationAction.isEnabled()); 201 } 202 }); 189 downloadChosenRelationAction.addPropertyChangeListener(evt -> downloadButton.setVisible(downloadChosenRelationAction.isEnabled())); 203 190 downloadButton.setVisible(false); 204 191 if (Config.getPref().getBoolean(PREF_PREFIX + ".hidetopline", false)) { … … 317 304 columns.getColumn(1).setPreferredWidth(40); 318 305 columns.getColumn(0).setPreferredWidth(220); 319 relationsTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() { 320 @Override 321 public void valueChanged(ListSelectionEvent e) { 322 int selectedRow = relationsTable.getSelectedRow(); 323 if (selectedRow >= 0) { 324 chosenRelation.set((Relation) relationsData.getValueAt(selectedRow, 0)); 325 relationsTable.clearSelection(); 326 } 306 relationsTable.getSelectionModel().addListSelectionListener(e -> { 307 int selectedRow = relationsTable.getSelectedRow(); 308 if (selectedRow >= 0) { 309 chosenRelation.set((Relation) relationsData.getValueAt(selectedRow, 0)); 310 relationsTable.clearSelection(); 327 311 } 328 312 }); 329 313 } 330 314 331 private JComponent sizeButton(JComponent b, int width, int height) {315 private static JComponent sizeButton(JComponent b, int width, int height) { 332 316 Dimension pref = b.getPreferredSize(); 333 317 b.setPreferredSize(new Dimension(width <= 0 ? pref.width : width, height <= 0 ? pref.height : height)); … … 495 479 dlg.setModalityType(ModalityType.DOCUMENT_MODAL); 496 480 497 role.getEditor().addActionListener(new ActionListener() { 498 @Override 499 public void actionPerformed(ActionEvent e) { 500 dlg.setVisible(false); 501 optionPane.setValue(JOptionPane.OK_OPTION); 502 } 481 role.getEditor().addActionListener(e -> { 482 dlg.setVisible(false); 483 optionPane.setValue(JOptionPane.OK_OPTION); 503 484 }); 504 485 … … 752 733 @Override 753 734 public void setSelectedItem(Object anItem) { 754 int newIndex = anItem instanceof String ? roles.indexOf( (String)anItem) : -1;735 int newIndex = anItem instanceof String ? roles.indexOf(anItem) : -1; 755 736 if (newIndex != selectedIndex) { 756 737 selectedIndex = newIndex; -
applications/editors/josm/plugins/reltoolbox/src/relcontext/actions/ReconstructPolygonAction.java
r36134 r36136 64 64 boolean wont = false; 65 65 for (RelationMember m : r.getMembers()) { 66 if (m.isWay() ) {66 if (m.isWay() && m.getWay().getReferrers().size() == 1) { 67 67 ways.add(m.getWay()); 68 68 } else { … … 72 72 if (wont) { 73 73 JOptionPane.showMessageDialog(MainApplication.getMainFrame(), 74 tr("Multipolygon must consist only of ways"), tr("Reconstruct polygon"), JOptionPane.ERROR_MESSAGE); 74 tr("Multipolygon must consist only of ways with one referring relation"), 75 tr("Reconstruct polygon"), JOptionPane.ERROR_MESSAGE); 75 76 return; 76 77 } … … 174 175 candidateWay = tmp; 175 176 } 176 final Command deleteCommand = DeleteCommand.delete(Collections.singleton(w)); 177 if (deleteCommand != null) { 178 commands.add(deleteCommand); 179 } 177 commands.add(new DeleteCommand(w)); 180 178 } 181 179 }
Note:
See TracChangeset
for help on using the changeset viewer.