Changeset 32277 in osm for applications/editors/josm
- Timestamp:
- 2016-06-16T00:39:07+02:00 (8 years ago)
- Location:
- applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/actions/IncompleteMembersDownloadThread.java
r32238 r32277 14 14 super(); 15 15 relation = r; 16 } 17 18 private void realRun() { 19 16 20 } 17 21 -
applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/gui/IncompleteMembersDownloadDialog.java
r32261 r32277 31 31 message = tr("The relation (id=" + id 32 32 + ") has incomplete members.\nThey need to be downloaded to proceed with validation of this relation.\nDo you want to download incomplete members?"); 33 checkbox = new JCheckBox(tr("Remember my choice and don' 't ask me again in this session"));33 checkbox = new JCheckBox(tr("Remember my choice and don't ask me again in this session")); 34 34 options = new String[2]; 35 35 options[0] = tr("Yes"); -
applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/gui/ProceedDialog.java
r32261 r32277 3 3 import static org.openstreetmap.josm.tools.I18n.tr; 4 4 5 import java.awt.BorderLayout;6 5 import java.awt.Component; 7 6 … … 13 12 import javax.swing.JPanel; 14 13 import javax.swing.JRadioButton; 14 import javax.swing.SwingUtilities; 15 15 16 16 public class ProceedDialog extends JPanel { … … 37 37 panel = new JPanel(); 38 38 panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS)); 39 39 40 40 JLabel label1 = new JLabel(tr("PT_Assistant plugin found that this relation (id=" + id + ") has errors:")); 41 41 panel.add(label1); 42 42 label1.setAlignmentX(Component.LEFT_ALIGNMENT); 43 43 44 44 if (numberOfDirectionErrors != 0) { 45 45 JLabel label2 = new JLabel(" " + numberOfDirectionErrors + tr(" direction errors")); … … 47 47 label2.setAlignmentX(Component.LEFT_ALIGNMENT); 48 48 } 49 49 50 50 if (numberOfRoadTypeErrors != 0) { 51 51 JLabel label3 = new JLabel(" " + numberOfRoadTypeErrors + tr(" road type errors")); … … 53 53 label3.setAlignmentX(Component.LEFT_ALIGNMENT); 54 54 } 55 55 56 56 JLabel label4 = new JLabel(tr("How do you want to proceed?")); 57 57 panel.add(label4); 58 58 label4.setAlignmentX(Component.LEFT_ALIGNMENT); 59 59 60 radioButtonFixAutomatically = new JRadioButton("Fix all errors automatically and proceed", 61 true); 62 radioButtonFixManually = new JRadioButton( 63 "I will fix the erros manually and click the button to proceed"); 60 radioButtonFixAutomatically = new JRadioButton("Fix all errors automatically and proceed", true); 61 radioButtonFixManually = new JRadioButton("I will fix the erros manually and click the button to proceed"); 64 62 radioButtonDontFix = new JRadioButton("Do not fix anything and proceed with further tests"); 65 63 ButtonGroup fixOptionButtonGroup = new ButtonGroup(); … … 73 71 radioButtonFixManually.setAlignmentX(Component.LEFT_ALIGNMENT); 74 72 radioButtonDontFix.setAlignmentX(Component.LEFT_ALIGNMENT); 75 76 73 77 checkbox = new JCheckBox(tr("Remember my choice and don' 't ask me again in this session"));74 checkbox = new JCheckBox(tr("Remember my choice and don't ask me again in this session")); 78 75 panel.add(checkbox); 79 76 checkbox.setAlignmentX(Component.LEFT_ALIGNMENT); 80 77 81 78 options = new String[2]; 82 79 options[0] = "OK"; … … 107 104 } 108 105 109 // FIXME: change to avoid EDT errors106 // showDialog(); FIXME 110 107 selectedOption = JOptionPane.showOptionDialog(this, panel, tr("PT_Assistant Proceed Request"), 111 108 JOptionPane.DEFAULT_OPTION, JOptionPane.QUESTION_MESSAGE, null, options, 0); 112 113 114 109 115 116 110 if (selectedOption == 0) { 117 111 if (radioButtonFixAutomatically.isSelected()) { … … 138 132 } 139 133 134 /** 135 * 136 */ 137 private void showDialog() { 138 139 if (!SwingUtilities.isEventDispatchThread()) { 140 selectedOption = JOptionPane.showOptionDialog(this, panel, tr("PT_Assistant Proceed Request"), 141 JOptionPane.DEFAULT_OPTION, JOptionPane.QUESTION_MESSAGE, null, options, 0); 142 } else { 143 144 SwingUtilities.invokeLater(new Runnable() { 145 @Override 146 public void run() { 147 showDialog(); 148 } 149 }); 150 151 } 152 153 } 154 140 155 } -
applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/utils/RouteUtils.java
r32252 r32277 127 127 } 128 128 129 if (way.hasTag("highway", "pedestrian") && (way.hasTag("bus", "yes") || way.hasTag("psv", "yes") 130 || way.hasTag("bus", "designated") || way.hasTag("psv", "designated"))) { 131 return true; 132 } 133 129 134 return false; 130 135 } -
applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/validation/DirectionTest.java
r32266 r32277 6 6 import java.util.List; 7 7 8 import javax.swing.JOptionPane;9 10 8 import org.openstreetmap.josm.command.ChangeCommand; 11 9 import org.openstreetmap.josm.command.Command; 12 10 import org.openstreetmap.josm.command.SequenceCommand; 13 import org.openstreetmap.josm.data.osm.Node;14 11 import org.openstreetmap.josm.data.osm.OsmPrimitive; 15 12 import org.openstreetmap.josm.data.osm.OsmPrimitiveType; … … 79 76 80 77 if (!waysToCheck.get(i).getWay().hasTag("busway", "lane") 78 && !waysToCheck.get(i).getWay().hasTag("busway:left", "lane") 79 && !waysToCheck.get(i).getWay().hasTag("busway:right", "lane") 81 80 && !waysToCheck.get(i).getWay().hasTag("oneway:bus", "no") 82 81 && !waysToCheck.get(i).getWay().hasTag("busway", "opposite_lane") -
applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/validation/PTAssitantValidatorTest.java
r32274 r32277 7 7 8 8 import javax.swing.JOptionPane; 9 import javax.swing.SwingUtilities; 9 10 10 11 import org.openstreetmap.josm.command.ChangeCommand; … … 113 114 } 114 115 116 115 117 ProceedDialog proceedDialog = new ProceedDialog(r.getId(), numberOfDirectionErrors, numberOfRoadTypeErrors); 116 117 118 int userInput = proceedDialog.getUserSelection(); 118 119 … … 138 139 139 140 } 141 140 142 141 143 /** -
applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/validation/WayChecker.java
r32266 r32277 42 42 this.test = test; 43 43 this.relation = r; 44 44 45 45 this.performDirectionTest(); 46 46 this.performRoadTypeTest(); 47 47 48 48 } 49 49 50 50 private void performRoadTypeTest() { 51 52 if (!relation.hasTag("route", "bus") && !relation.hasTag("route", "trolleybus") && !relation.hasTag("route", "share_taxi")) { 51 52 if (!relation.hasTag("route", "bus") && !relation.hasTag("route", "trolleybus") 53 && !relation.hasTag("route", "share_taxi")) { 53 54 return; 54 55 } … … 137 138 138 139 if (!waysToCheck.get(i).getWay().hasTag("busway", "lane") 140 && !waysToCheck.get(i).getWay().hasTag("busway:left", "lane") 141 && !waysToCheck.get(i).getWay().hasTag("busway:right", "lane") 139 142 && !waysToCheck.get(i).getWay().hasTag("oneway:bus", "no") 140 143 && !waysToCheck.get(i).getWay().hasTag("busway", "opposite_lane") … … 183 186 } 184 187 188 if (way.hasTag("highway", "pedestrian") && (way.hasTag("bus", "yes") || way.hasTag("psv", "yes") 189 || way.hasTag("bus", "designated") || way.hasTag("psv", "designated"))) { 190 return true; 191 } 192 185 193 return false; 186 194 }
Note:
See TracChangeset
for help on using the changeset viewer.