Changeset 8510 in josm for trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/query/AdvancedChangesetQueryPanel.java
- Timestamp:
- 2015-06-20T23:42:21+02:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/query/AdvancedChangesetQueryPanel.java
r8461 r8510 60 60 ItemListener stateChangeHandler = new RestrictionGroupStateChangeHandler(); 61 61 JPanel pnl = new VerticallyScrollablePanel(); 62 pnl.setBorder(BorderFactory.createEmptyBorder(5, 5,5,5));62 pnl.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); 63 63 pnl.setLayout(new GridBagLayout()); 64 64 GridBagConstraints gc = new GridBagConstraints(); … … 74 74 gc.gridx = 1; 75 75 gc.weightx = 1.0; 76 pnl.add(new JMultilineLabel(tr("Select changesets owned by specific users")), gc);76 pnl.add(new JMultilineLabel(tr("Select changesets owned by specific users")), gc); 77 77 78 78 gc.gridy = 1; … … 93 93 gc.gridx = 1; 94 94 gc.weightx = 1.0; 95 pnl.add(new JMultilineLabel(tr("Select changesets depending on whether they are open or closed")), gc);95 pnl.add(new JMultilineLabel(tr("Select changesets depending on whether they are open or closed")), gc); 96 96 97 97 gc.gridy = 3; … … 112 112 gc.gridx = 1; 113 113 gc.weightx = 1.0; 114 pnl.add(new JMultilineLabel(tr("Select changesets based on the date/time they have been created or closed")), gc);114 pnl.add(new JMultilineLabel(tr("Select changesets based on the date/time they have been created or closed")), gc); 115 115 116 116 gc.gridy = 5; … … 132 132 gc.gridx = 1; 133 133 gc.weightx = 1.0; 134 pnl.add(new JMultilineLabel(tr("Select only changesets related to a specific bounding box")), gc);134 pnl.add(new JMultilineLabel(tr("Select only changesets related to a specific bounding box")), gc); 135 135 136 136 gc.gridy = 7; … … 143 143 gc.gridx = 0; 144 144 gc.gridwidth = 2; 145 gc.fill =GridBagConstraints.BOTH;145 gc.fill = GridBagConstraints.BOTH; 146 146 gc.weightx = 1.0; 147 147 gc.weighty = 1.0; … … 289 289 setLayout(new GridBagLayout()); 290 290 setBorder(BorderFactory.createCompoundBorder( 291 BorderFactory.createEmptyBorder(3, 3,3,3),291 BorderFactory.createEmptyBorder(3, 3, 3, 3), 292 292 BorderFactory.createCompoundBorder( 293 293 BorderFactory.createLineBorder(Color.GRAY), 294 BorderFactory.createEmptyBorder(5, 5,5,5)294 BorderFactory.createEmptyBorder(5, 5, 5, 5) 295 295 ) 296 296 )); … … 389 389 gc.fill = GridBagConstraints.HORIZONTAL; 390 390 gc.weightx = 0.0; 391 gc.insets = new Insets(0, 0,0,3);391 gc.insets = new Insets(0, 0, 0, 3); 392 392 pnl.add(new JLabel(tr("User ID:")), gc); 393 393 394 394 gc.gridx = 1; 395 pnl.add(tfUid = new JosmTextField(10), gc);395 pnl.add(tfUid = new JosmTextField(10), gc); 396 396 SelectAllOnFocusGainedDecorator.decorate(tfUid); 397 397 valUid = UidInputFieldValidator.decorate(tfUid); … … 409 409 gc.fill = GridBagConstraints.HORIZONTAL; 410 410 gc.weightx = 0.0; 411 gc.insets = new Insets(0, 0,0,3);411 gc.insets = new Insets(0, 0, 0, 3); 412 412 pnl.add(new JLabel(tr("User name:")), gc); 413 413 414 414 gc.gridx = 1; 415 pnl.add(tfUserName = new JosmTextField(10), gc);415 pnl.add(tfUserName = new JosmTextField(10), gc); 416 416 SelectAllOnFocusGainedDecorator.decorate(tfUserName); 417 417 valUserName = UserNameInputValidator.decorate(tfUserName); … … 427 427 setLayout(new GridBagLayout()); 428 428 setBorder(BorderFactory.createCompoundBorder( 429 BorderFactory.createEmptyBorder(3, 3,3,3),429 BorderFactory.createEmptyBorder(3, 3, 3, 3), 430 430 BorderFactory.createCompoundBorder( 431 431 BorderFactory.createLineBorder(Color.GRAY), 432 BorderFactory.createEmptyBorder(5, 5,5,5)432 BorderFactory.createEmptyBorder(5, 5, 5, 5) 433 433 ) 434 434 )); … … 438 438 gc.anchor = GridBagConstraints.NORTHWEST; 439 439 gc.gridx = 0; 440 gc.fill = GridBagConstraints.HORIZONTAL;440 gc.fill = GridBagConstraints.HORIZONTAL; 441 441 gc.weightx = 0.0; 442 442 add(rbRestrictToMyself = new JRadioButton(), gc); … … 450 450 gc.gridx = 0; 451 451 gc.gridy = 1; 452 gc.fill = GridBagConstraints.HORIZONTAL;452 gc.fill = GridBagConstraints.HORIZONTAL; 453 453 gc.weightx = 0.0; 454 454 add(rbRestrictToUid = new JRadioButton(), gc); … … 458 458 gc.fill = GridBagConstraints.HORIZONTAL; 459 459 gc.weightx = 1.0; 460 add(new JMultilineLabel(tr("Only changesets owned by the user with the following user ID")), gc);460 add(new JMultilineLabel(tr("Only changesets owned by the user with the following user ID")), gc); 461 461 462 462 gc.gridx = 1; … … 464 464 gc.fill = GridBagConstraints.HORIZONTAL; 465 465 gc.weightx = 1.0; 466 add(buildUidInputPanel(), gc);466 add(buildUidInputPanel(), gc); 467 467 468 468 gc.gridx = 0; 469 469 gc.gridy = 3; 470 gc.fill = GridBagConstraints.HORIZONTAL;470 gc.fill = GridBagConstraints.HORIZONTAL; 471 471 gc.weightx = 0.0; 472 472 add(rbRestrictToUserName = new JRadioButton(), gc); … … 474 474 475 475 gc.gridx = 1; 476 gc.fill = 477 gc.weightx = 1.0; 478 add(new JMultilineLabel(tr("Only changesets owned by the user with the following user name")), gc);476 gc.fill = GridBagConstraints.HORIZONTAL; 477 gc.weightx = 1.0; 478 add(new JMultilineLabel(tr("Only changesets owned by the user with the following user name")), gc); 479 479 480 480 gc.gridx = 1; 481 481 gc.gridy = 4; 482 gc.fill = 483 gc.weightx = 1.0; 484 add(buildUserNameInputPanel(), gc);482 gc.fill = GridBagConstraints.HORIZONTAL; 483 gc.weightx = 1.0; 484 add(buildUserNameInputPanel(), gc); 485 485 486 486 bgUserRestrictions = new ButtonGroup(); … … 541 541 } 542 542 543 544 543 public boolean isValidChangesetQuery() { 545 544 if (rbRestrictToUid.isSelected()) … … 656 655 gc.fill = GridBagConstraints.HORIZONTAL; 657 656 gc.weightx = 0.0; 658 gc.insets = new Insets(0, 0,0,3);657 gc.insets = new Insets(0, 0, 0, 3); 659 658 pnl.add(new JLabel(tr("Date: ")), gc); 660 659 661 660 gc.gridx = 1; 662 661 gc.weightx = 0.7; 663 pnl.add(tfClosedAfterDate1 = new JosmTextField(), gc);662 pnl.add(tfClosedAfterDate1 = new JosmTextField(), gc); 664 663 SelectAllOnFocusGainedDecorator.decorate(tfClosedAfterDate1); 665 664 valClosedAfterDate1 = DateValidator.decorate(tfClosedAfterDate1); … … 668 667 gc.gridx = 2; 669 668 gc.weightx = 0.0; 670 pnl.add(new JLabel(tr("Time:")), gc);669 pnl.add(new JLabel(tr("Time:")), gc); 671 670 672 671 gc.gridx = 3; 673 672 gc.weightx = 0.3; 674 pnl.add(tfClosedAfterTime1 = new JosmTextField(), gc);673 pnl.add(tfClosedAfterTime1 = new JosmTextField(), gc); 675 674 SelectAllOnFocusGainedDecorator.decorate(tfClosedAfterTime1); 676 675 valClosedAfterTime1 = TimeValidator.decorate(tfClosedAfterTime1); … … 684 683 gc.fill = GridBagConstraints.HORIZONTAL; 685 684 gc.weightx = 0.0; 686 gc.insets = new Insets(0, 0,0,3);685 gc.insets = new Insets(0, 0, 0, 3); 687 686 pnl.add(new JLabel(tr("Closed after - ")), gc); 688 687 … … 690 689 gc.fill = GridBagConstraints.HORIZONTAL; 691 690 gc.weightx = 0.0; 692 gc.insets = new Insets(0, 0,0,3);691 gc.insets = new Insets(0, 0, 0, 3); 693 692 pnl.add(new JLabel(tr("Date:")), gc); 694 693 695 694 gc.gridx = 2; 696 695 gc.weightx = 0.7; 697 pnl.add(tfClosedAfterDate2 = new JosmTextField(), gc);696 pnl.add(tfClosedAfterDate2 = new JosmTextField(), gc); 698 697 SelectAllOnFocusGainedDecorator.decorate(tfClosedAfterDate2); 699 698 valClosedAfterDate2 = DateValidator.decorate(tfClosedAfterDate2); … … 701 700 gc.gridx = 3; 702 701 gc.weightx = 0.0; 703 pnl.add(new JLabel(tr("Time:")), gc);702 pnl.add(new JLabel(tr("Time:")), gc); 704 703 705 704 gc.gridx = 4; 706 705 gc.weightx = 0.3; 707 pnl.add(tfClosedAfterTime2 = new JosmTextField(), gc);706 pnl.add(tfClosedAfterTime2 = new JosmTextField(), gc); 708 707 SelectAllOnFocusGainedDecorator.decorate(tfClosedAfterTime2); 709 708 valClosedAfterTime2 = TimeValidator.decorate(tfClosedAfterTime2); … … 714 713 gc.fill = GridBagConstraints.HORIZONTAL; 715 714 gc.weightx = 0.0; 716 gc.insets = new Insets(0, 0,0,3);715 gc.insets = new Insets(0, 0, 0, 3); 717 716 pnl.add(new JLabel(tr("Created before - ")), gc); 718 717 … … 720 719 gc.fill = GridBagConstraints.HORIZONTAL; 721 720 gc.weightx = 0.0; 722 gc.insets = new Insets(0, 0,0,3);721 gc.insets = new Insets(0, 0, 0, 3); 723 722 pnl.add(new JLabel(tr("Date:")), gc); 724 723 725 724 gc.gridx = 2; 726 725 gc.weightx = 0.7; 727 pnl.add(tfCreatedBeforeDate = new JosmTextField(), gc);726 pnl.add(tfCreatedBeforeDate = new JosmTextField(), gc); 728 727 SelectAllOnFocusGainedDecorator.decorate(tfCreatedBeforeDate); 729 728 valCreatedBeforeDate = DateValidator.decorate(tfCreatedBeforeDate); … … 732 731 gc.gridx = 3; 733 732 gc.weightx = 0.0; 734 pnl.add(new JLabel(tr("Time:")), gc);733 pnl.add(new JLabel(tr("Time:")), gc); 735 734 736 735 gc.gridx = 4; 737 736 gc.weightx = 0.3; 738 pnl.add(tfCreatedBeforeTime = new JosmTextField(), gc);737 pnl.add(tfCreatedBeforeTime = new JosmTextField(), gc); 739 738 SelectAllOnFocusGainedDecorator.decorate(tfCreatedBeforeTime); 740 739 valCreatedBeforeTime = TimeValidator.decorate(tfCreatedBeforeTime); … … 747 746 setLayout(new GridBagLayout()); 748 747 setBorder(BorderFactory.createCompoundBorder( 749 BorderFactory.createEmptyBorder(3, 3,3,3),748 BorderFactory.createEmptyBorder(3, 3, 3, 3), 750 749 BorderFactory.createCompoundBorder( 751 750 BorderFactory.createLineBorder(Color.GRAY), 752 BorderFactory.createEmptyBorder(5, 5,5,5)751 BorderFactory.createEmptyBorder(5, 5, 5, 5) 753 752 ) 754 753 )); … … 759 758 gc.anchor = GridBagConstraints.NORTHWEST; 760 759 gc.gridx = 0; 761 gc.fill = GridBagConstraints.HORIZONTAL;760 gc.fill = GridBagConstraints.HORIZONTAL; 762 761 gc.weightx = 0.0; 763 762 add(rbClosedAfter = new JRadioButton(), gc); 764 763 765 764 gc.gridx = 1; 766 gc.fill = 765 gc.fill = GridBagConstraints.HORIZONTAL; 767 766 gc.weightx = 1.0; 768 767 add(new JMultilineLabel(tr("Only changesets closed after the following date/time")), gc); … … 770 769 gc.gridx = 1; 771 770 gc.gridy = 1; 772 gc.fill = 773 gc.weightx = 1.0; 774 add(buildClosedAfterInputPanel(), gc);771 gc.fill = GridBagConstraints.HORIZONTAL; 772 gc.weightx = 1.0; 773 add(buildClosedAfterInputPanel(), gc); 775 774 776 775 // -- changesets closed after a specific date/time and created before a specific date time … … 780 779 gc.gridy = 2; 781 780 gc.gridx = 0; 782 gc.fill = GridBagConstraints.HORIZONTAL;781 gc.fill = GridBagConstraints.HORIZONTAL; 783 782 gc.weightx = 0.0; 784 783 add(rbClosedAfterAndCreatedBefore = new JRadioButton(), gc); 785 784 786 785 gc.gridx = 1; 787 gc.fill = 786 gc.fill = GridBagConstraints.HORIZONTAL; 788 787 gc.weightx = 1.0; 789 788 add(new JMultilineLabel(tr("Only changesets closed after and created before a specific date/time")), gc); … … 791 790 gc.gridx = 1; 792 791 gc.gridy = 3; 793 gc.fill = 794 gc.weightx = 1.0; 795 add(buildClosedAfterAndCreatedBeforeInputPanel(), gc);792 gc.fill = GridBagConstraints.HORIZONTAL; 793 gc.weightx = 1.0; 794 add(buildClosedAfterAndCreatedBeforeInputPanel(), gc); 796 795 797 796 ButtonGroup bg = new ButtonGroup(); … … 876 875 } 877 876 878 879 877 public void rememberSettings() { 880 878 String prefRoot = "changeset-query.advanced.time-restrictions"; … … 930 928 public BBoxRestrictionPanel() { 931 929 setBorder(BorderFactory.createCompoundBorder( 932 BorderFactory.createEmptyBorder(3, 3,3,3),930 BorderFactory.createEmptyBorder(3, 3, 3, 3), 933 931 BorderFactory.createCompoundBorder( 934 932 BorderFactory.createLineBorder(Color.GRAY), 935 BorderFactory.createEmptyBorder(5, 5,5,5)933 BorderFactory.createEmptyBorder(5, 5, 5, 5) 936 934 ) 937 935 )); … … 994 992 return; 995 993 } 996 } catch (NumberFormatException e) {994 } catch (NumberFormatException e) { 997 995 feedbackInvalid(tr("The current value is not a valid user ID. Please enter an integer value > 0")); 998 996 return; … … 1008 1006 if (uid > 0) return uid; 1009 1007 return 0; 1010 } catch (NumberFormatException e) {1008 } catch (NumberFormatException e) { 1011 1009 return 0; 1012 1010 } … … 1163 1161 try { 1164 1162 return DateFormat.getTimeInstance(style, Locale.getDefault()).parse(getComponent().getText()); 1165 } catch (ParseException e) {1163 } catch (ParseException e) { 1166 1164 continue; 1167 1165 }
Note:
See TracChangeset
for help on using the changeset viewer.