Changeset 33005 in osm for applications/editors
- Timestamp:
- 2016-09-23T22:03:59+02:00 (8 years ago)
- Location:
- applications/editors/josm/plugins/addrinterpolation
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/addrinterpolation/.project
r32286 r33005 16 16 </arguments> 17 17 </buildCommand> 18 <buildCommand> 19 <name>net.sf.eclipsecs.core.CheckstyleBuilder</name> 20 <arguments> 21 </arguments> 22 </buildCommand> 18 23 </buildSpec> 19 24 <natures> 20 25 <nature>org.eclipse.jdt.core.javanature</nature> 26 <nature>net.sf.eclipsecs.core.CheckstyleNature</nature> 21 27 </natures> 22 28 </projectDescription> -
applications/editors/josm/plugins/addrinterpolation/src/org/openstreetmap/josm/plugins/AddrInterpolation/AddrInterpolationAction.java
r29854 r33005 1 // License: GPL. Copyright 2009 by Mike Nice and others 2 // Connects from JOSM menu action to Plugin 1 // License: GPL. For details, see LICENSE file. 3 2 package org.openstreetmap.josm.plugins.AddrInterpolation; 4 3 … … 16 15 import org.openstreetmap.josm.tools.Shortcut; 17 16 18 19 17 @SuppressWarnings("serial") 20 public 18 public class AddrInterpolationAction extends JosmAction implements 21 19 SelectionChangedListener { 22 20 23 public AddrInterpolationAction() {21 public AddrInterpolationAction() { 24 22 super(tr("Address Interpolation"), "AddrInterpolation", tr("Handy Address Interpolation Functions"), 25 23 Shortcut.registerShortcut("tools:AddressInterpolation", tr("Tool: {0}", tr("Address Interpolation")), … … 43 41 } 44 42 setEnabled(false); 45 46 43 } 47 48 44 } 49 50 -
applications/editors/josm/plugins/addrinterpolation/src/org/openstreetmap/josm/plugins/AddrInterpolation/AddrInterpolationDialog.java
r32482 r33005 1 // License: GPL. Copyright 2009 by Mike Nice and others 2 3 // Main plugin logic 1 // License: GPL. For details, see LICENSE file. 4 2 package org.openstreetmap.josm.plugins.AddrInterpolation; 5 3 … … 59 57 import org.openstreetmap.josm.tools.ImageProvider; 60 58 61 public class AddrInterpolationDialog extends JDialog implements ActionListener 59 public class AddrInterpolationDialog extends JDialog implements ActionListener { 62 60 63 61 private Way selectedStreet = null; … … 76 74 77 75 // Edit controls 78 private EscapeDialog dialog =null;76 private EscapeDialog dialog = null; 79 77 private JRadioButton streetNameButton = null; 80 private JRadioButton streetRelationButton 78 private JRadioButton streetRelationButton = null; 81 79 private JTextField startTextField = null; 82 80 private JTextField endTextField = null; … … 95 93 // NOTE: The following 2 arrays must match in number of elements and position 96 94 // Tag values for map (Except that 'Numeric' is replaced by actual # on map) 97 String[] addrInterpolationTags = { "odd", "even", "all", "alphabetic", "Numeric"};98 String[] addrInterpolationStrings = { 95 String[] addrInterpolationTags = {"odd", "even", "all", "alphabetic", "Numeric"}; 96 String[] addrInterpolationStrings = {tr("Odd"), tr("Even"), tr("All"), tr("Alphabetic"), tr("Numeric") }; // Translatable names for display 99 97 private final int NumericIndex = 4; 100 98 private JComboBox<String> addrInterpolationList = null; 101 99 102 100 // NOTE: The following 2 arrays must match in number of elements and position 103 String[] addrInclusionTags = { 104 String[] addrInclusionStrings = { 101 String[] addrInclusionTags = {"actual", "estimate", "potential" }; // Tag values for map 102 String[] addrInclusionStrings = {tr("Actual"), tr("Estimate"), tr("Potential") }; // Translatable names for display 105 103 private JComboBox<String> addrInclusionList = null; 106 104 … … 124 122 125 123 dialog.add(editControlsPane); 126 dialog.setSize(new Dimension(300, 500));127 dialog.setLocation(new Point(100, 300));124 dialog.setSize(new Dimension(300, 500)); 125 dialog.setLocation(new Point(100, 300)); 128 126 129 127 // Listen for windowOpened event to set focus 130 dialog.addWindowListener( new WindowAdapter() 131 { 128 dialog.addWindowListener(new WindowAdapter() { 132 129 @Override 133 public void windowOpened( WindowEvent e ) 134 { 130 public void windowOpened(WindowEvent e) { 135 131 if (addrInterpolationWay != null) { 136 132 startTextField.requestFocus(); 137 } 138 else { 133 } else { 139 134 cityTextField.requestFocus(); 140 135 } … … 163 158 editControlsPane.setLayout(gridbag); 164 159 165 editControlsPane.setBorder(BorderFactory.createEmptyBorder(15, 15,15,15));160 editControlsPane.setBorder(BorderFactory.createEmptyBorder(15, 15, 15, 15)); 166 161 167 162 String streetName = selectedStreet.get("name"); … … 174 169 if (associatedStreetRelation == null) { 175 170 streetNameButton.setSelected(true); 176 } else {171 } else { 177 172 streetRelationButton.setSelected(true); 178 173 } … … 217 212 JLabel[] textLabels = {startLabel, endLabel, numberingLabel, incrementLabel, inclusionLabel}; 218 213 Component[] editFields = {startTextField, endTextField, addrInterpolationList, incrementTextField, addrInclusionList}; 219 AddEditControlRows(textLabels, editFields, 214 AddEditControlRows(textLabels, editFields, editControlsPane); 220 215 221 216 cbConvertToHouseNumbers = new Checkbox(tr("Convert way to individual house numbers."), null, lastConvertToHousenumber); … … 259 254 addrInterpolationList.addFocusListener(new FocusAdapter() { 260 255 @Override 261 public void focusGained(FocusEvent fe) {256 public void focusGained(FocusEvent fe) { 262 257 if (!interpolationMethodSet) { 263 258 if (AutoDetectInterpolationMethod()) { … … 271 266 // Numeric increment box can be enabled or disabled. 272 267 addrInterpolationList.addActionListener(new ActionListener() { 273 public void actionPerformed(ActionEvent e) {268 public void actionPerformed(ActionEvent e) { 274 269 int selectedIndex = addrInterpolationList.getSelectedIndex(); 275 270 incrementTextField.setEnabled(selectedIndex == NumericIndex); // Enable or disable numeric field … … 281 276 if (houseNumberNodes.size() > 0) { 282 277 JLabel houseNumberNodeNote = new JLabel(tr("Will associate {0} additional house number nodes", 283 houseNumberNodes.size() 278 houseNumberNodes.size())); 284 279 editControlsPane.add(houseNumberNodeNote, c); 285 280 } 286 281 287 282 editControlsPane.add(new UrlLabel("http://wiki.openstreetmap.org/wiki/JOSM/Plugins/AddrInterpolation", 288 tr("More information about this feature"), 2), c);283 tr("More information about this feature"), 2), c); 289 284 290 285 c.gridx = 0; … … 320 315 String startValueString = ReadTextField(startTextField); 321 316 String endValueString = ReadTextField(endTextField); 322 if ( (startValueString == null) || (endValueString== null)) {317 if ((startValueString == null) || (endValueString == null)) { 323 318 // Not all values entered yet 324 319 return false; … … 329 324 if (isLong(startValueString) && isLong(endValueString)) { 330 325 // Have 2 numeric values 331 long startValue = Long.parseLong( startValueString);332 long endValue = Long.parseLong( endValueString);326 long startValue = Long.parseLong(startValueString); 327 long endValue = Long.parseLong(endValueString); 333 328 334 329 if (isEven(startValue)) { 335 330 if (isEven(endValue)) { 336 331 SelectInterpolationMethod("even"); 337 } 338 else { 332 } else { 339 333 SelectInterpolationMethod("all"); 340 334 } … … 342 336 if (!isEven(endValue)) { 343 337 SelectInterpolationMethod("odd"); 344 } 345 else { 338 } else { 346 339 SelectInterpolationMethod("all"); 347 340 } … … 352 345 char endingChar = endValueString.charAt(endValueString.length()-1); 353 346 354 if ( (!IsNumeric("" + startingChar)) && (!IsNumeric("" + endingChar))) {347 if ((!IsNumeric("" + startingChar)) && (!IsNumeric("" + endingChar))) { 355 348 // Both end with alpha 356 349 SelectInterpolationMethod("alphabetic"); … … 358 351 } 359 352 360 if ( (IsNumeric("" + startingChar)) && (!IsNumeric("" + endingChar))) {353 if ((IsNumeric("" + startingChar)) && (!IsNumeric("" + endingChar))) { 361 354 endingChar = Character.toUpperCase(endingChar); 362 if ( (endingChar >= 'A') && (endingChar <= 'Z')) {355 if ((endingChar >= 'A') && (endingChar <= 'Z')) { 363 356 // First is a number, last is Latin alpha 364 357 SelectInterpolationMethod("alphabetic"); … … 381 374 incrementTextField.setText(currentMethod); 382 375 incrementTextField.setEnabled(true); 383 } 384 else { 376 } else { 385 377 // Must scan OSM key values because combo box is already loaded with translated strings 386 for (int i =0; i<addrInterpolationTags.length; i++) {378 for (int i = 0; i < addrInterpolationTags.length; i++) { 387 379 if (addrInterpolationTags[i].equals(currentMethod)) { 388 380 currentIndex = i; … … 399 391 int currentIndex = 0; 400 392 // Must scan OSM key values because combo box is already loaded with translated strings 401 for (int i =0; i<addrInclusionTags.length; i++) {393 for (int i = 0; i < addrInclusionTags.length; i++) { 402 394 if (addrInclusionTags[i].equals(currentMethod)) { 403 395 currentIndex = i; … … 416 408 editControlsPane.setLayout(gridbag); 417 409 418 editControlsPane.setBorder(BorderFactory.createEmptyBorder(5, 5,5,5));410 editControlsPane.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); 419 411 420 412 JLabel[] optionalTextLabels = {new JLabel(tr("City:")), … … 433 425 @Override 434 426 public void keyTyped(KeyEvent e) { 435 JTextField jtextfield = (JTextField) e.getSource();427 JTextField jtextfield = (JTextField) e.getSource(); 436 428 String text = jtextfield.getText(); 437 429 int length = text.length(); … … 444 436 // Accept key; convert to upper case 445 437 if (!e.isActionKey()) { 446 e.setKeyChar(Character.toUpperCase(e.getKeyChar()) 438 e.setKeyChar(Character.toUpperCase(e.getKeyChar())); 447 439 } 448 440 } … … 451 443 452 444 Component[] optionalEditFields = {cityTextField, stateTextField, postCodeTextField, countryTextField, fullTextField}; 453 AddEditControlRows(optionalTextLabels, optionalEditFields, 445 AddEditControlRows(optionalTextLabels, optionalEditFields, editControlsPane); 454 446 455 447 JPanel optionPanel = new JPanel(new BorderLayout()); … … 543 535 if (relationType.equals("associatedStreet")) { 544 536 for (RelationMember relationMember : relation.getMembers()) { 545 if (relationMember.isWay()) {537 if (relationMember.isWay()) { 546 538 Way way = (Way) relationMember.getMember(); 547 539 // System.out.println("Name: " + way.get("name") ); … … 552 544 String streetName = ""; 553 545 if (relation.getKeys().containsKey("name")) { 554 streetName = 546 streetName = relation.get("name"); 555 547 } else { 556 548 // Relation is unnamed - use street name 557 streetName = 549 streetName = selectedStreet.get("name"); 558 550 } 559 551 relationDescription += " (" + streetName + ")"; … … 561 553 } 562 554 } 563 564 555 } 565 556 } … … 590 581 namedWayCount++; 591 582 this.selectedStreet = way; 592 } 593 else { 583 } else { 594 584 unNamedWayCount++; 595 585 this.addrInterpolationWay = way; … … 600 590 // Either selected or in the middle of the Address Interpolation way 601 591 // Do not include end points of Address Interpolation way in this set yet. 602 houseNumberNodes 592 houseNumberNodes = new ArrayList<>(); 603 593 // Check selected nodes 604 594 for (OsmPrimitive osm : currentDataSet.getSelectedNodes()) { … … 612 602 // Check nodes in middle of address interpolation way 613 603 if (addrInterpolationWay.getNodesCount() > 2) { 614 for (int i =1; i<(addrInterpolationWay.getNodesCount()-2); i++) {604 for (int i = 1; i < (addrInterpolationWay.getNodesCount()-2); i++) { 615 605 Node testNode = addrInterpolationWay.getNode(i); 616 606 if (testNode.getKeys().containsKey("addr:housenumber")) { … … 682 672 dialog.dispose(); 683 673 } 684 } else 674 } else if ("cancel".equals(e.getActionCommand())) { 685 675 dialog.dispose(); 686 676 } … … 694 684 if (strValue.length() > 0) { 695 685 return strValue.substring(0, strValue.length()-1); 696 } 697 else { 686 } else { 698 687 return ""; 699 688 } … … 703 692 if (strValue.length() > 0) { 704 693 return strValue.charAt(strValue.length()-1); 705 } 706 else { 694 } else { 707 695 return 0; 708 696 } … … 710 698 711 699 // Test for valid positive long int 712 private boolean isLong( String input ) { 713 try 714 { 715 Long val = Long.parseLong( input ); 700 private boolean isLong(String input) { 701 try { 702 Long val = Long.parseLong(input); 716 703 return (val > 0); 717 } 718 catch( Exception e) 719 { 704 } catch (Exception e) { 720 705 return false; 721 706 } 722 707 } 723 708 724 private boolean isEven( Long input ) 725 { 726 return ((input %2) == 0); 709 private boolean isEven(Long input) { 710 return ((input % 2) == 0); 727 711 } 728 712 … … 737 721 738 722 String baseAlpha = BaseAlpha(endValueString); 739 int nSegments =endNodeIndex - startNodeIndex;723 int nSegments = endNodeIndex - startNodeIndex; 740 724 741 725 double[] segmentLengths = new double[nSegments]; 742 726 // Total length of address interpolation way section 743 double totalLength = CalculateSegmentLengths(startNodeIndex, endNodeIndex, segmentLengths);727 double totalLength = CalculateSegmentLengths(startNodeIndex, endNodeIndex, segmentLengths); 744 728 745 729 … … 751 735 Node lastHouseNode = addrInterpolationWay.getNode(startNodeIndex); 752 736 int currentSegment = 0; // Segment being used to place new house # node 753 char currentChar = startingChar;737 char currentChar = startingChar; 754 738 while (nHouses > 0) { 755 739 double distanceNeeded = houseSpacing; … … 769 753 Node newHouseNumberNode = new Node(newHouseNumberPosition); 770 754 currentChar++; 771 if ( (currentChar >'Z') && (currentChar <'a')) {755 if ((currentChar > 'Z') && (currentChar < 'a')) { 772 756 // Wraparound past uppercase Z: go directly to lower case a 773 757 currentChar = 'a'; … … 784 768 785 769 segmentLengths[currentSegment] -= distanceNeeded; // Track amount used 786 nHouses --;770 nHouses--; 787 771 } 788 772 } … … 800 784 // Search for possible anchors from the 2nd node to 2nd from last, interpolating between each anchor 801 785 int startIndex = 0; // Index into first interpolation zone of address interpolation way 802 for (int i =1; i<addrInterpolationWay.getNodesCount()-1; i++) {786 for (int i = 1; i < addrInterpolationWay.getNodesCount()-1; i++) { 803 787 Node testNode = addrInterpolationWay.getNode(i); 804 788 String endNodeNumber = testNode.get("addr:housenumber"); … … 807 791 if (endNodeNumber != "") { 808 792 char anchorChar = LastChar(endNodeNumber); 809 if ( (anchorChar >startingChar) && (anchorChar < endingChar)) {793 if ((anchorChar > startingChar) && (anchorChar < endingChar)) { 810 794 // Lies within the expected range 811 795 InterpolateAlphaSection(startIndex, i, endNodeNumber, startingChar, anchorChar); … … 825 809 } 826 810 827 private double CalculateSegmentLengths(int startNodeIndex, int endNodeIndex, double segmentLengths[]) {811 private double CalculateSegmentLengths(int startNodeIndex, int endNodeIndex, double[] segmentLengths) { 828 812 Node fromNode = addrInterpolationWay.getNode(startNodeIndex); 829 813 double totalLength = 0.0; … … 831 815 for (int segment = 0; segment < nSegments; segment++) { 832 816 Node toNode = addrInterpolationWay.getNode(startNodeIndex + 1 + segment); 833 segmentLengths[segment] = fromNode.getCoor().greatCircleDistance(toNode.getCoor());817 segmentLengths[segment] = fromNode.getCoor().greatCircleDistance(toNode.getCoor()); 834 818 totalLength += segmentLengths[segment]; 835 819 … … 843 827 long increment) { 844 828 845 int nSegments =endNodeIndex - startNodeIndex;829 int nSegments = endNodeIndex - startNodeIndex; 846 830 847 831 double[] segmentLengths = new double[nSegments]; 848 832 849 833 // Total length of address interpolation way section 850 double totalLength = CalculateSegmentLengths(startNodeIndex, endNodeIndex, segmentLengths);851 852 int nHouses = (int) ((endingAddr - startingAddr) / increment) -1;834 double totalLength = CalculateSegmentLengths(startNodeIndex, endNodeIndex, segmentLengths); 835 836 int nHouses = (int) ((endingAddr - startingAddr) / increment) -1; 853 837 if (nHouses > 0) { 854 838 … … 885 869 886 870 segmentLengths[currentSegment] -= distanceNeeded; // Track amount used 887 nHouses --;871 nHouses--; 888 872 } 889 873 } … … 892 876 private void CreateNumericInterpolation(String startValueString, String endValueString, long increment) { 893 877 894 long startingAddr = Long.parseLong( startValueString);895 long endingAddr = Long.parseLong( endValueString);878 long startingAddr = Long.parseLong(startValueString); 879 long endingAddr = Long.parseLong(endValueString); 896 880 897 881 // Search for possible anchors from the 2nd node to 2nd from last, interpolating between each anchor 898 882 int startIndex = 0; // Index into first interpolation zone of address interpolation way 899 for (int i =1; i<addrInterpolationWay.getNodesCount()-1; i++) {883 for (int i = 1; i < addrInterpolationWay.getNodesCount()-1; i++) { 900 884 Node testNode = addrInterpolationWay.getNode(i); 901 885 String strEndNodeNumber = testNode.get("addr:housenumber"); … … 904 888 if (isLong(strEndNodeNumber)) { 905 889 906 long anchorAddrNumber = Long.parseLong( strEndNodeNumber);907 if ( (anchorAddrNumber >startingAddr) && (anchorAddrNumber < endingAddr)) {890 long anchorAddrNumber = Long.parseLong(strEndNodeNumber); 891 if ((anchorAddrNumber > startingAddr) && (anchorAddrNumber < endingAddr)) { 908 892 // Lies within the expected range 909 893 InterpolateNumericSection(startIndex, i, startingAddr, anchorAddrNumber, increment); … … 954 938 955 939 // Remove untagged nodes 956 for (int i =1; i<addrInterpolationWay.getNodesCount()-1; i++) {940 for (int i = 1; i < addrInterpolationWay.getNodesCount()-1; i++) { 957 941 Node testNode = addrInterpolationWay.getNode(i); 958 942 if (!testNode.hasKeys()) { … … 977 961 String selectedMethod = GetInterpolationMethod(); 978 962 if (addrInterpolationWay != null) { 979 Long startAddr =0L, endAddr=0L;963 Long startAddr = 0L, endAddr = 0L; 980 964 if (!selectedMethod.equals("alphabetic")) { 981 965 Long[] addrArray = {startAddr, endAddr}; 982 if (!ValidAddressNumbers(startValueString, endValueString, addrArray 966 if (!ValidAddressNumbers(startValueString, endValueString, addrArray)) { 983 967 return false; 984 968 } … … 1009 993 } 1010 994 if (!errorMessage.equals("")) { 1011 JOptionPane.showMessageDialog(Main.parent, errorMessage, tr("Error"), 995 JOptionPane.showMessageDialog(Main.parent, errorMessage, tr("Error"), JOptionPane.ERROR_MESSAGE); 1012 996 return false; 1013 997 } … … 1017 1001 if (country.length() != 2) { 1018 1002 JOptionPane.showMessageDialog(Main.parent, 1019 tr("Country code must be 2 letters"), tr("Error"), 1003 tr("Country code must be 2 letters"), tr("Error"), JOptionPane.ERROR_MESSAGE); 1020 1004 return false; 1021 1005 } … … 1086 1070 AddToRelation(associatedStreetRelation, node, "house"); 1087 1071 } 1088 if ((city != null) || (streetNameButton.isSelected()) 1072 if ((city != null) || (streetNameButton.isSelected())) { 1089 1073 // Include street unconditionally if adding nodes only or city name specified 1090 1074 commandGroup.add(new ChangePropertyCommand(node, "addr:street", streetName)); … … 1102 1086 } 1103 1087 1104 1105 1088 Main.main.undoRedo.add(new SequenceCommand(tr("Address Interpolation"), commandGroup)); 1106 1089 Main.map.repaint(); … … 1115 1098 } 1116 1099 long testIncrement = Long.parseLong(incrementString); 1117 if ( (testIncrement <=0) || (testIncrement > endingAddr )) {1100 if ((testIncrement <= 0) || (testIncrement > endingAddr)) { 1118 1101 return false; 1119 1102 } 1120 1103 1121 if ( 1104 if (((endingAddr - startingAddr) % testIncrement) != 0) { 1122 1105 return false; 1123 1106 } … … 1150 1133 // Test if relation contains specified member 1151 1134 // If not already present, it is added 1152 private void AddToRelation(Relation relation, 1135 private void AddToRelation(Relation relation, OsmPrimitive testMember, String role) { 1153 1136 boolean isFound = false; 1154 1137 for (RelationMember relationMember : relation.getMembers()) { … … 1174 1157 private String ValidateAlphaAddress(String startValueString, 1175 1158 String endValueString) { 1176 String errorMessage ="";1159 String errorMessage = ""; 1177 1160 1178 1161 if (startValueString.equals("") || endValueString.equals("")) { … … 1184 1167 1185 1168 boolean isOk = false; 1186 if ( (IsNumeric("" + startingChar)) && (!IsNumeric("" + endingChar))) {1169 if ((IsNumeric("" + startingChar)) && (!IsNumeric("" + endingChar))) { 1187 1170 endingChar = Character.toUpperCase(endingChar); 1188 if ( (endingChar >= 'A') && (endingChar <= 'Z')) {1171 if ((endingChar >= 'A') && (endingChar <= 'Z')) { 1189 1172 // First is a number, last is Latin alpha 1190 1173 isOk = true; 1191 1174 } 1192 } else if ( (!IsNumeric("" + startingChar)) && (!IsNumeric("" + endingChar))) {1175 } else if ((!IsNumeric("" + startingChar)) && (!IsNumeric("" + endingChar))) { 1193 1176 // Both are alpha 1194 1177 isOk = true; … … 1197 1180 errorMessage = tr("Alphabetic address must end with a letter"); 1198 1181 } 1199 1200 1182 1201 1183 // if a number is included, validate that it is the same number … … 1235 1217 } 1236 1218 if (errorMessage.equals("")) { 1237 addrArray[0] = Long.parseLong( startValueString);1238 addrArray[1] = Long.parseLong( endValueString);1219 addrArray[0] = Long.parseLong(startValueString); 1220 addrArray[1] = Long.parseLong(endValueString); 1239 1221 1240 1222 if (addrArray[1] <= addrArray[0]) { … … 1247 1229 1248 1230 } else { 1249 JOptionPane.showMessageDialog(Main.parent, errorMessage, tr("Error"), 1231 JOptionPane.showMessageDialog(Main.parent, errorMessage, tr("Error"), JOptionPane.ERROR_MESSAGE); 1250 1232 return false; 1251 1233 } -
applications/editors/josm/plugins/addrinterpolation/src/org/openstreetmap/josm/plugins/AddrInterpolation/AddrInterpolationPlugin.java
r29778 r33005 1 // License: GPL. Copyright 2009 by Mike Nice and others1 // License: GPL. For details, see LICENSE file. 2 2 package org.openstreetmap.josm.plugins.AddrInterpolation; 3 4 3 5 4 import org.openstreetmap.josm.Main; -
applications/editors/josm/plugins/addrinterpolation/src/org/openstreetmap/josm/plugins/AddrInterpolation/EscapeDialog.java
r23191 r33005 1 // License: GPL. Copyright 2009 by Mike Nice and others 2 // Handles ESC key to close a dialog 1 // License: GPL. For details, see LICENSE file. 3 2 package org.openstreetmap.josm.plugins.AddrInterpolation; 4 3 … … 16 15 public class EscapeDialog extends JDialog { 17 16 public EscapeDialog() { 18 this((Frame) null, false);17 this((Frame) null, false); 19 18 } 19 20 20 public EscapeDialog(Frame owner) { 21 21 this(owner, false); 22 22 } 23 23 24 public EscapeDialog(Frame owner, boolean modal) { 24 25 this(owner, null, modal); 25 26 } 27 26 28 public EscapeDialog(Frame owner, String title) { 27 29 this(owner, title, false); 28 30 } 31 29 32 public EscapeDialog(Frame owner, String title, boolean modal) { 30 33 super(owner, title, modal); 31 34 } 35 32 36 public EscapeDialog(Dialog owner) { 33 37 this(owner, false); 34 38 } 39 35 40 public EscapeDialog(Dialog owner, boolean modal) { 36 41 this(owner, null, modal); 37 42 } 43 38 44 public EscapeDialog(Dialog owner, String title) { 39 45 this(owner, title, false); 40 46 } 47 41 48 public EscapeDialog(Dialog owner, String title, boolean modal) { 42 49 super(owner, title, modal); 43 50 } 44 45 51 46 52 @Override
Note:
See TracChangeset
for help on using the changeset viewer.